weballey logo
 
left forms - checkbox backnext right
homesearchsite mape-mail
intro
text
textarea
buttons
image
form
e-mail form
< checkbox >
radio
select
password
hidden
layout
cgi
tags
epilogue
      Often you will only need to know if something is true or not. To this purpose you can use the checkbox. Next to the checkbox you will display a text, containing a statement. Like "Check this box if you would like to be on this and this mailing list." Nine out of ten times you don't want to be on any mailing list, but if you do, you can check the box next to it.

<INPUT TYPE="checkbox" NAME="mailinglist" VALUE="true">

I want to be on your mailing list.

    As you might expect right now, this is just another incarnation of the input tag. This time the type is set to "checkbox". The value is not shown in your browser. The name and value are only submitted if the box is checked, otherwise it is ignored. You can also use this tag to make lists with multiple checkboxes.

<INPUT TYPE="checkbox" NAME="color_red" VALUE="true">
<INPUT TYPE="checkbox" NAME="color_blue" VALUE="true">
<INPUT TYPE="checkbox" NAME="color_green" VALUE="true">
<INPUT TYPE="checkbox" NAME="color_yellow" VALUE="true">

I like the following colors:
red
blue
green
yellow

    What if I want the box already checked, you may asked. Well, then you just tell the browser that. A simple attribute CHECKED in the input tag will do that for you.

<INPUT TYPE="checkbox" NAME="mailinglist" VALUE="true" CHECKED>

I want to be on your mailing list.
bottom  
left Copyright © Gerben Hoekstra - All rights reserved backnext right