Frequently Asked Questions

Check boxes?

How can I make a question with checkboxes to choose the answers?

Checkboxes are used to allow the user to select more than one item from a list. Here’s an example:

<p>Which of the following TV shows do you watch? (choose any combination)
<br /><input type="checkbox" name="friends" value="Y" />Friends
<br /><input type="checkbox" name="er" value="Y" />ER
<br /><input type="checkbox" name="willandgrace" value="Y" />Will&Grace
<br /><input type="checkbox" name="gilmoregirls" value="Y" />Gilmore Girls
<br /><input type="checkbox" name="that70sshow" value="Y" />That 70's Show</p>

Now, the inital value of a checkbox can be defined to be checked or not. If you want any box to be already checked by default, you have to add ‘checked=”checked”‘ in their form definition, like so:

<p>Which of the following TV shows do you watch? (choose any combination)
<br /><input type="checkbox" name="friends" value="Y" checked="checked" />Friends
<br /><input type="checkbox" name="er" value="Y" />ER
<br /><input type="checkbox" name="willandgrace" value="Y" />Will&Grace
<br /><input type="checkbox" name="gilmoregirls" value="Y" checked="checked" />Gilmore Girls
<br /><input type="checkbox" name="that70sshow" value="Y" />That 70's Show</p>

Now you have both Friends and Gilmore Girls checked as default.