A Sample Form



Here is a sample form. If you click the submit button, it will send the results to me in name/value pairs. The name is taken from the name argument in the tokens. The value is usually the input value.

With check boxes, the value is one of the arguments and it is only sent when the box is checked. For radio buttons, the value of the selected radio button is sent.

Copy the html, change the mailto to your address, fill out the form and submit it. What you get is hard to read but it can be figured out.

<FORM METHOD="POST" ACTION="mailto:chrisk@pacific.net">

This prompts for text input. It sets the input box to 24 characters, but you can enter more or less.
<input size = 24 name = "name"> : Name<br>

: Name

This prompts for up-to 3 characters.
<input size = 3 maxlength = 3 name = "initials"> : Initials (i.e., CHK)

: Initials (i.e., CHK)

This allows you to choose from a list of options. It shows 2 options at a time.
<select size=2 name="mode"> <option selected>Go <option>Stop <option>I don't care </select>

This makes a check box. If the box is checked the name/value pair are sent.
<input name="box1" type="checkbox" value="I only get sent when the check box is turned on">

: Check me

Only one of these radio buttons can be selected at one time.
<input name="radio1" type="radio" value="button A"> : Button A
<input name="radio1" type="radio" value="button B"> : Button B

: Button A
: Button B

This puts up a big text box, 48 chars wide, and 5 rows long.
<textarea name = "comments" rows=5 cols = 48></textarea>

Comments:

Input types of submit and reset make buttons that do just what you think they should.
<input name="button1" type="submit" value="Submit"> <input name="button2" type="reset" value="Reset">


This page hosted by GeoCities.
Get your own Free Home Page.