TYPE = CHECKBOX
CHECKBOX creates a checkbox which can be either on or off:
this code |
produces this |
<FORM ACTION="../cgi-bin/mycgi.pl">
<INPUT TYPE=CHECKBOX NAME="maillist">Yes! Put me on the list!<P>
<INPUT TYPE=SUBMIT VALUE="submit">
</FORM>
|
|
CHECKBOX is often used in groups to indicate a series of choices any one of which can be on or off:
this code |
produces this |
<FORM ACTION="../cgi-bin/mycgi.pl">
<INPUT TYPE=CHECKBOX NAME="mushrooms" >mushrooms<BR>
<INPUT TYPE=CHECKBOX NAME="greenpeppers">green peppers<BR>
<INPUT TYPE=CHECKBOX NAME="olives" >olives<BR>
<INPUT TYPE=CHECKBOX NAME="onions" >onions<P>
<INPUT TYPE=SUBMIT VALUE="submit">
</FORM>
|
|
By default, the checkbox is initially off. If you want the checkbox initially on, use
the
CHECKED attribute. Checkbox CHECKBOX s are only sent to the CGI if they are on; if they are off, no name/value pair is sent (try out the form above to see).
|