Contents / Previous / Next


Forms

Define a form: <FORM action=URL method=post> . . . </FORM> Attributes: action="URL" : program that will process the form or email address where to send the form. method="post" or "get" : method how the called program accesses the form data. * "post": from stdin * "get": from HTTP environment variable "QUERY_STRING"

Input Field: Assigns a value to a variable.

<INPUT> (there is no ending tag) Attributes: name="textstring" : symbolic name (not displayed) identifying the input variable type="variable_type" : specifies the data type for the variable * "text" and "password" * "checkbox" * "radio" : radio buttons * "submit" : action button that submits the form to server * "reset" : button that resets the form to default values * "hidden" : invisible input field * "image" : image map within a form and returns the coordinates of a mouse click within the image value="textstring" : meaning of textstring depends on the argument for type: * "text" or "password" : default value * "checkbox" or "radio" : textstring will be sent to server if the checkbox is "checked" * "reset" or "submit" : textstring will appear button checked No arguments. size="display_width" maxlength="string_length" EXAMPLE: <INPUT type="text" name="text1" value="default text"> <INPUT type="password" name="password1" value="ciao"> <INPUT type="checkbox" name="checkbox1" value="checkbox"> <INPUT type="radio" name="radio1" value="radio">

Select Field: Displays a set of optional list items.

<SELECT multiple> <OPTION>Apples <OPTION selected>Bananas <OPTION>Cherries </SELECT> Attributes: name="textstring" : symbolic identifier for the select field variable size="list_length" : number of <OPTION> items that will be multiple No arguments : allows selection of more than one <OPTION> value

Text Area: Rectangular field to enter text data.

<TEXTAREA> . . . default text . . . </TEXTAREA> Attributes: name="textstring" : symbolic name that identifies the <TEXTAREA> variable rows="num_rows" and cols="numcols"

It is useful to layout the elements of a form in a table.