Basic HTML version of Foils prepared 11 May 1997

Foil 24 Content Fields of a Form: Radio Buttons and Checkboxes

From Introduction to HTML--ECS400 fall 97 ECS400 Senior Undergraduate Course -- Spring Semester 97. by Nancy J. McCracken *

1 A checkbox field has the form
2 Pepperoni <input type="checkbox" name="pepperoni">
3 If the user checks the box, then pepperoni=on is sent to the CGI program. Or you can add a value attribute such as value="ok", and then value=ok is sent.
4 Radio buttons are similar except that you typically put several of them with the same name field and the browser only allows one of them to be checked.
5 <input type="radio" name="topping" value="pepperoni"><br>
6 <input type="radio" name="topping" value="mushroom">
7 If the user checks mushroom, then topping=mushroom is sent to the CGI program.
8 Both fields allow an attribute checked, which makes the default value be on.
9 <input type="checkbox" name="pepperoni" checked>

in Table To:


© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Aug 26 1997