Learn HTML Code Tutorial Reference Guide

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>
Yes! Put me on the list!

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>
mushrooms
green peppers
olives
onions

By default, the checkbox is initially off. If you want the checkbox initially on, use the CHECKED attribute. Checkbox CHECKBOXs 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).




 

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   Privacy Policy   |   About
Copyright ©1997-2002 Idocs and ©2002-2014 HTML Code Tutorial