Forms Course

 

CHECKBOX Field

The INPUT TYPE of CHECKBOX will produce a small box to allow the user to select from a list of items. Multiple items can be selected with the CHECKBOX field.

Here is the line of code for CHECKBOX INPUT:

<INPUT TYPE="checkbox">

Next we must add an identifying NAME to this field. Again, each new CHECKBOX field needs it's own unique NAME.

<INPUT TYPE="checkbox" NAME="descriptive text">

Let's take a look at what that will produce:

Next let's add a VALUE to our CHECKBOX. This VALUE (text) will be submitted with the form and be viewable next to the NAME.
Here is a example code with the VALUE added.

<INPUT TYPE="checkbox" NAME="descriptive text" VALUE="some text here">

So let's add a few CHECKBOX INPUTS to our code:

<FORM ACTION="mailto:whoever@nowhere.org" METHOD="POST" ENCTYPE="text/plain">
<b>Who Are You ?</b>
<INPUT TYPE="text" NAME="name of sender" SIZE="15">
<p>
<b>What Sites Have You Been To ?</b>
<p>
<b>Draac.Com</b>
<INPUT TYPE="checkbox" NAME="Have they been to draac.com ?" VALUE="Yes, has been to draac.com.">
<b>Gifs 123</b>
<INPUT TYPE="checkbox" NAME="Have they been to gifs 123 ?" VALUE="Yes, has been to gifs 123.">
<b>The Board</b>
<INPUT TYPE="checkbox" NAME="Have they been to the board ?" VALUE="Yes, has been to the board.">

<p>
<INPUT TYPE="submit" VALUE="Submit This Form">
</FORM>

Here is what our form looks like now:

Note: My example forms in this course are non-functioning and can not be submitted.

Who Are You ?

What Sites Have You Been To ?

Draac.Com Gifs 123 The Board

Try this form on a web page before you continue. Add your email address and submit the form to yourself and view the results. This will help you to understand what you have just learned. Once you have tested this form, click "next" and continue with the forms course.