I want to know that if i want checkbox with two options how to do it pls tell me | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

I want to know that if i want checkbox with two options how to do it pls tell me

please

18th Dec 2016, 10:54 PM
Harshit Sharma
Harshit Sharma - avatar
2 Answers
+ 4
copy-paste: <label class="radio"><input type="checkbox" name="service[1]" value="Option 1" />Option 1</label> <label class="radio"><input type="checkbox" name="service[2]" value="Option 2" />Option 2</label> <label class="radio"><input type="checkbox" name="service[3]" value="Option 3" />Option 3</label> Notice service[] with values in the brackets, such as: service[1], service[2], service[3] etc. This is to easily refer to them with CSS, Js or PHP later on. Hope this helped!
19th Dec 2016, 1:13 AM
Tristan McCullen
Tristan McCullen - avatar
+ 3
Further more: label class is 'radio' and input type is 'checkbox' = creates a checkbox with multiple choices. name = to connect the function. Value = What you see when you hover the pointer over it.
19th Dec 2016, 1:23 AM
Tristan McCullen
Tristan McCullen - avatar