George Fox University | Offices and Services | Institutional Technology | Using Checkboxes to Allow Multiple Selections

Using Checkboxes to Allow Multiple Selections

If you have a limited selection, want to give the user the ability to select multiple choices, and you want to control the choices, use a checkbox tag.



<form method=post action="https://scripts.georgefox.edu/cgi-bin/FormMail.pl" name="example3">

<input type=hidden name=recipient value=bweldon@georgefox.edu>

I'd accept a free ticket to ...[check all that apply]<br>

<input type=checkbox name=destination-hawaii value=yes>Hawaii<br>

<input type=checkbox name=destination-london value=yes>London<br>

<input type=checkbox name=destination-portland value=yes>Portland<br>

<br><input type=submit name=submit value=submit><input type=reset name=reset value=reset>

</form>



The CHECKBOX tag allows you to create a list of items that you want the user to select from, and they can even make multiple selections. You can even pre-select items for them. You can have as many checkboxes as you want. Let's talk about it's attributes.

  1. TYPE - when set to "checkbox", you'll get the checkbox. Required for each checkbox you want.
  2. NAME - this is the name part of the name/value pair that will be sent to the email receipent.
  3. VALUE - if the checkbox is checked, this is the data value that will be sent to the email receipent.
  4. CHECKED - when included, this will pre-select the checkbox. Optional, and can be used on multiple checkboxes.
I'd accept a free ticket to ...[check all that apply]
Hawaii
London
Portland

This page was last updated 3-29-2008 19:09:58.
For questions or comments about this page, please email the webmaster.