Form Tags and Attributes:

FORM INPUT SELECT TEXTAREA
Tag Attributes Comments
<FORM> .... </FORM> Creates a form area, can not be nested.  Requires the ACTION attribute be specified, other attributes optional. 

ACTION="...url..."

Indicates the CGI script to process the form input. URL can be relative or absolute. To process as an email message include,  mailto: to make the ACTION a valid URL.

METHOD="get/post"

Indicates the method with which the form input is given to the script that processes the form.  GET is default method. In an HTMaiL form the method will always be POST. 

ENCTYPE="mime type/subtype"

Specifies the way the data will be   encoded (what MIME type used) before being transmitted.  (MIME - multipurpose Internet Mail Extensions.)
<INPUT  NAME="zip"  TYPE=text   SIZE=4  MAXVALUE=10  VALUE="48502" >
<INPUT> A field of the form.  There is no </INPUT>

NAME="name"

The programmer defined label.  Every INPUT must have a name except the Submit and Reset buttons.

TYPE=type

Type of form element.  Possible values include:

BUTTON - for general purpose buttons on a web page
CHECKBOX - an on/off switch
HIDDEN - not displayed on the screen, but can be passed on to the CGI script that processes the form.
IMAGE - creates a clickable image, similar to an image map, that behaves like a submit button.
PASSWORD - field is identical to a text field except the characters typed by the user are displayed as bullets or asterisks.
RADIO - a radio button
RESET - makes a button that resets the default values of the form
SUBMIT - a button to submit the form to the script that processes it
TEXT - creates a single-line text field.

SIZE="size of text field"

Used only with the TEXT type, indicates the size of the text field in characters. (default is 20)
MAXLENGTH="max # chars" Used only with the TEXT type, indicates the maximum number of characters this text field will accept.

VALUE="default value"

The default value for the form element (optional).  For SUBMIT and RESET buttons indicates the label of the button.

CHECKED

Used only with CHECKBOX or RADIO input.  Indicates that this element is selected by default.

SRC="..url.. "

Used only with  IMAGE type, indicates the path or URL to the image file.
<TEXTAREA   ROWS=5  COLS=40  NAME="comments" WRAP="HARD">   default text here </TEXTAREA>
<TEXTAREA> ... </TEXTAREA> Creates a free form scroll box in which the user may enter data longer than would be practically input in a text input box. Note requires the </TEXTAREA> tag.

NAME

Specifies the name that will be sent to the CGI program.

ROWS

Specifies the number of visible lines of text.  If more lines of text than can fit are entered, scrollbars will be added.

COLS

Specifies the visible width of the text area, based on the average width of characters in the font being used.

WRAP

A nonstandard attribute, specifies what to do with lines that are longer than the size specified by COLS.  I is supported by Netscape in version 2.0 and later. 

OFF disables word warp, and is the default. 
HARD ( or physical) causes words to warp on screen and the associated line breaks to be transmitted when the form is submitted.
SOFT ( or virtual) causes the words to warp on screen, but no extra line breaks to be transmitted with the form is submitted.

<SELECT   NAME="color"> <OPTION> red <OPTION> green <OPTION> blue </SELECT>

<SELECT> ....  </SELECT> Used to present a set of options to the user. The choices are specified via OPTION entries embedded in the SELECT element.  The terminating tag </SELECT> ends the options list.

NAME

Identifies the form element to the target CGI program, or label on mailed data.

SIZE

Gives the number of visible rows.

MULTIPLE

Specifies that multiple entries can be selected simultaneously.  If multiple is omitted, only a single selection is permitted.
 
FORM INPUT SELECT TEXTAREA

        

Last updated on Feb. 6th, 2002 by L.M. Hicks