Web Forms HTML Reference Document

Tag

Common Attributes

FORM

The FORM tag defines the entire form. It describes where the entered content will be sent when the SUBMIT button is pressed. It also defines how the information will be structured.

ACTION describes where the entered content will be sent (usually a URL)

METHOD describes how the entered content should be formatted (either GET or POST)

Example:

<FORM METH0D="get" ACTION="http://sample.com/bin/process.cgi">

</FORM>

The FORM tag must recede all form element tags and an ending FORM tag should occur after the form elements.

INPUT

The <INPUT> tag displays devices that the reader of a web page can use to submit information.

NAME is the label for a specific input element. When information is entered into a textbox or other element, it is the name that identifies the information to the server.

VALUE is the content that will be passed on to the server if no content is entered, or if that particular radio button or checkbox is selected.

SIZE defines the width of TEXT type inputs.

MAXLENGTH defines the maximum number of characters that can be entered.

TYPE describes the kind of input device to be displayed. Types include:

TEXT (a standard, one line text box),

HIDDEN (no input device at all. The information in the VALUE attribute is automatically delivered),

RADIO (displays a radio button. If it is clicked on, then the information in the VALUE attribute is delivered),

CHECKBOX (displays a check box. If it is check true, then the information in the value attribute is delivered),

RESET (displays a reset button which sets all of the input fields to their default),

SUBMIT (displays a submit button that sends to its destination, all of the information that has been entered into the form)

Example:

<INPUT TYPE=text VALUE="yes" NAME="answer">

From this tag, a textbox will be displayed with the word "yes" automatically appearing in the box (the user can replace "yes" with another answer). When the submit button is clicked, the information is sent to its destination.

TEXTAREA

The TEXTAREA tag displays a larger text box within which several lines of text can be entered.

NAME is the label for a specific input element. When information is entered into a textbox or other element, it is the name that identifies the information to the server.

ROWS defines the number of rows in height for the scrolling text box.

COLS defines the number of columns or characters in width for the scrolling text box.

WRAP indicates whether the text entered into the box will word wrap. PHYSICAL or VIRTUAL indicates that it will wrap. OFF indicates that it will not wrap.

Example:

<TEXTAREA COLS=30 ROWS=3 NAME="x">

</TEXTAREA>

Note:Text that is entered into the HTML file between the beginning and ending TEXTAREA tags will appear in the multi-line text box.

SELECT & OPTION

The SELECT tags define dropdown and scrolling menus. One OPTION tag is necessary for each option in the menu.

NAME is the label for a specific input element. When information is entered into a textbox or other element, it is the name that identifies the information to the server.

VALUE is the content that will be passed on to the server. In the SELECT/OPTION form element, the VALUE is included in the OPTION tags, so that when and option is selected that value will be carried to the server.

SIZE helps indicate how the menu will appear. If the size is one (1), then the code will produce a drop down menu. If the size equals the number of items or options, then a menu window will be produced. If the size is more than 1 but less than the number of options, then a scrolling menu window will be displayed.

MULTIPLE

If the word MULTIPLE is included in the SELECT tag, then users will be able to select multiple options.

Example:

<SELECT NAME="choice" SIZE=3>

<OPTION VALUE=A>Dog

<OPTION VALUE=B>Cat

<OPTION VALUE=C>Hamster

<OPTION VALUE=D>Lizzard

</SELECTED>


This content comes from the book Raw Materials for the Mind, by David Warlick ISBN 0-9667432-0-2
http://landmark-project.com/rmfm.html