webmaster resources tips and articles
webmaster information

Path = Home : Form Tips : How To Create A Checkbox Form

How To Create A Checkbox Form

 

The <input> tag is used to create input fields within a web page form.

You can create a checkbox selection list by adding attributes to the input tag.

Note that unlike a a radio button form where only one button can be selected at a time, a checkbox can have any number of boxes selected at the same time.

Checkbox selection list

<input type="checkbox" name="choice1"> Choice 1
<input type="checkbox" name="choice2"> Choice 2
<input type="checkbox" name="choice3"> Choice 3

Choice 1
Choice 2
Choice 3

Setting a default value

You can set a default value by adding checked="checked" to the input tag.

<input type="checkbox" name="choice1" checked="checked"> Choice 1<br>
<input type="checkbox" name="choice2"> Choice 2<br>
<input type="checkbox" name="choice3"> Choice 3

Choice 1
Choice 2
Choice 3

 

All boxes checked by default

<input type="checkbox" name="choice1" checked="checked"> Choice 1<br>
<input type="checkbox" name="choice2" checked="checked"> Choice 2<br>
<input type="checkbox" name="choice3" checked="checked"> Choice 3

Choice 1
Choice 2
Choice 3

 


 

 

© janim.net 2000 - 2008 All rights reserved