George Fox University | Offices and Services | Institutional Technology | Adding Single Selections with Radio Buttons

Adding Single Selections with Radio Buttons

If you have a limited selection, only want the user to select one choice, and you want to control the choices, try using a radio button tag.



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

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

My favorite vacation temperature is ...<br>

<input type=radio name=temperature value="in the 60's">in the 60's<br>

<input type=radio name=temperature value="in the 70's" checked>in the 70's<br>

<input type=radio name=temperature value="in the 80's">in the 80's<br>

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

</form>



The RADIO BUTTON tag allows you to create a list of items that you want the user to select from, but only select one item. You can even pre-select an item for them. You can have as many radio buttons as you want. Let's talk about it's attributes.

  1. TYPE - when set to "radio", you'll get the radio button. Required for each radio button you want.
  2. NAME - required to group the radio buttons together.
  3. VALUE - this is the data value that will be sent to the email receipent.
  4. CHECKED - when included, this will pre-select the radio button. Optional, can only be used on a single radio button.

The form should look like this on a web page now.

My favorite vacation temperature is ...
in the 60's
in the 70's
in the 80's

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