Checkbox Buttons

5 minutes
Share the link to this page
Copied
  Completed
You need to have access to the item to view this lesson.
One-time Fee
$99.99
List Price:  $139.99
You save:  $40
€93.69
List Price:  €131.17
You save:  €37.48
£77.60
List Price:  £108.65
You save:  £31.04
CA$139.29
List Price:  CA$195.02
You save:  CA$55.72
A$151.87
List Price:  A$212.63
You save:  A$60.75
S$133.13
List Price:  S$186.38
You save:  S$53.25
HK$777.29
List Price:  HK$1,088.24
You save:  HK$310.95
CHF 87.93
List Price:  CHF 123.11
You save:  CHF 35.17
NOK kr1,104.77
List Price:  NOK kr1,546.73
You save:  NOK kr441.95
DKK kr698.68
List Price:  DKK kr978.18
You save:  DKK kr279.50
NZ$167.57
List Price:  NZ$234.61
You save:  NZ$67.03
د.إ367.26
List Price:  د.إ514.18
You save:  د.إ146.92
৳12,019.14
List Price:  ৳16,827.28
You save:  ৳4,808.14
₹8,437.49
List Price:  ₹11,812.83
You save:  ₹3,375.33
RM440.95
List Price:  RM617.35
You save:  RM176.40
₦168,038.19
List Price:  ₦235,260.19
You save:  ₦67,222
₨27,930.87
List Price:  ₨39,104.34
You save:  ₨11,173.46
฿3,435.35
List Price:  ฿4,809.63
You save:  ฿1,374.28
₺3,432.75
List Price:  ₺4,805.99
You save:  ₺1,373.23
B$578.39
List Price:  B$809.77
You save:  B$231.38
R1,775.91
List Price:  R2,486.34
You save:  R710.43
Лв183.06
List Price:  Лв256.30
You save:  Лв73.23
₩139,696.36
List Price:  ₩195,580.49
You save:  ₩55,884.13
₪373.04
List Price:  ₪522.27
You save:  ₪149.23
₱5,864.11
List Price:  ₱8,209.99
You save:  ₱2,345.87
¥15,367.99
List Price:  ¥21,515.80
You save:  ¥6,147.81
MX$2,036.44
List Price:  MX$2,851.10
You save:  MX$814.65
QR365.08
List Price:  QR511.13
You save:  QR146.04
P1,334.01
List Price:  P1,867.67
You save:  P533.65
KSh12,898.71
List Price:  KSh18,058.71
You save:  KSh5,160
E£4,921.85
List Price:  E£6,890.79
You save:  E£1,968.94
ብር12,453.44
List Price:  ብር17,435.32
You save:  ብር4,981.87
Kz91,125.91
List Price:  Kz127,579.93
You save:  Kz36,454.01
CLP$97,077.66
List Price:  CLP$135,912.62
You save:  CLP$38,834.95
CN¥719.49
List Price:  CN¥1,007.32
You save:  CN¥287.82
RD$6,057.20
List Price:  RD$8,480.32
You save:  RD$2,423.12
DA13,406.48
List Price:  DA18,769.61
You save:  DA5,363.12
FJ$225.25
List Price:  FJ$315.36
You save:  FJ$90.11
Q777.28
List Price:  Q1,088.22
You save:  Q310.94
GY$21,042.91
List Price:  GY$29,460.92
You save:  GY$8,418
ISK kr13,914.60
List Price:  ISK kr19,481
You save:  ISK kr5,566.40
DH993.26
List Price:  DH1,390.60
You save:  DH397.34
L1,803.93
List Price:  L2,525.57
You save:  L721.64
ден5,764.94
List Price:  ден8,071.14
You save:  ден2,306.20
MOP$805.37
List Price:  MOP$1,127.55
You save:  MOP$322.18
N$1,760.19
List Price:  N$2,464.34
You save:  N$704.14
C$3,701.17
List Price:  C$5,181.79
You save:  C$1,480.61
रु13,577.81
List Price:  रु19,009.47
You save:  रु5,431.66
S/377.27
List Price:  S/528.20
You save:  S/150.92
K403.78
List Price:  K565.32
You save:  K161.53
SAR375.56
List Price:  SAR525.80
You save:  SAR150.24
ZK2,738.35
List Price:  ZK3,833.81
You save:  ZK1,095.45
L466.14
List Price:  L652.62
You save:  L186.47
Kč2,371.47
List Price:  Kč3,320.16
You save:  Kč948.68
Ft38,315.49
List Price:  Ft53,643.23
You save:  Ft15,327.73
SEK kr1,086.64
List Price:  SEK kr1,521.34
You save:  SEK kr434.70
ARS$99,364.60
List Price:  ARS$139,114.41
You save:  ARS$39,749.81
Bs696.54
List Price:  Bs975.19
You save:  Bs278.64
COP$434,893.49
List Price:  COP$608,868.29
You save:  COP$173,974.79
₡51,449.82
List Price:  ₡72,031.81
You save:  ₡20,581.98
L2,537.81
List Price:  L3,553.04
You save:  L1,015.22
₲786,505.60
List Price:  ₲1,101,139.31
You save:  ₲314,633.70
$U4,173.81
List Price:  $U5,843.51
You save:  $U1,669.69
zł406.70
List Price:  zł569.40
You save:  zł162.69
Already have an account? Log In

Transcript

Hello, in this bootstrap four video, we're going to show you check box buttons. Up to now we've just done regular buttons, though we've got different types, this essentially styling. So if let's say I were to click on this one, or were to click on this one, or this one, or this one is essentially just the user clicking on it, and it performing an action where the checkbox has two different states on and also the user can toggle between them. The usage of something like this can be for surveys, so you can select something like a certain selection item. Also, you can also use it for login forms. When the user logs in.

You can check a little check box is very common on user logging systems over the web, that it keeps you signing the info, let's say X amount of days. So that's where a check box from you for locally bootstrap really simplifies the process and it's really just an extension of what we've learned in terms of buttons. Escape code in go to your cloud is going to add it after all the other buttons, you can do it in a fresh project is not a problem. I'm gonna put some brake lines. On first of all you want a div, the div is going to have a class of btn dash group because it's going to be a button group is going to contain buttons with in it. So we want data, dash toggle equals buttons.

And now you need to put a label and the label is gonna have a class of btn btn dazs primary, I want to make the first one active is just going to be selected by default. Obviously, if you don't want any selected by default, then you don't have to, if you do, you just simply have to put this active class and Alec seocho btn primary and btn. This is essentially what we've been doing for the different types and different styles of buttons. So what I recommend is after you've watched this video, actually mix and match some of these different styles in to the check box, it will be fine. We definitely do recommend that you check that out. What you're going to need within the label is an input so the input is going to have a type of checkbox.

And if you want it to be active checked, aka selected need to pour an empty attribute called checked for autocomplete. pleat equals off. And now just simply put some text I'm going to put check box one is selected. And to actually save some time, I'm just going to copy and paste this and show you what a checkbox looks like when it's not selected. So you just get rid of the active class and get rid of the empty checked attribute. somes gonna change this to checkbox, too.

And that looks a Okay, so if we save this now, go to our web browser refresh. There you go. We have a checkbox. You may be thinking that you've seen checkboxes for before and they don't look like this. They usually just look like a square. And yeah, they do.

If you want, they can just remove some of these classes, add a bit of styling, get a look into where you want it. But in terms of functionality, this is a checkbox so far. Click this, it's no longer checked, is checked, no longer checked for click, it is checked, whereas a regular button like this one, if I click it, it's no longer selected when I go when I take focus off it, whereas if I select this, I'll go somewhere else, it is still selected. So that's how you use checkboxes within bootstrap version four. Obviously, to actually use this in your project, you want to use some sort of jQuery or some sort of PHP language, and actually detect where it's been selected or not, and code it so it does something accordingly that's specific to your website. If you have any questions, feel free to post them on sonar learning.co.uk forward slash question dot php, there'll be a link in the description.

There'll be another link in the description to the source code from this video. So if you have any query these want to check out the code. Check that out. Please rate, comment and subscribe. It does really help keep the content free. Plus it also helps us provide more content on a regular basis.

And as usual, thanks for watching and have a great day.

Sign Up

Share

Share with friends, get 20% off
Invite your friends to LearnDesk learning marketplace. For each purchase they make, you get 20% off (upto $10) on your next purchase.