Section for Week 6, Tuesday, 2/16/99 Form related tags and their attribute modifiers: Top level elements: FORM, INPUT, SELECT, and TEXTAREA. Their modifiers are: FORM
INPUT Text Field: INPUT TYPE=TEXT Required attributes are: NAME name for the form field corresponding to this element. The optional attributes are: MAXLENGTH constrains the number of characters that can be entered into a text input field. If the value of MAXLENGTH is greater the the value of the SIZE attribute, the field should scroll appropriately. The default number of characters is unlimited. SIZE specifies the amount of display space allocated to this input field according to its type. The default depends on the user agent. VALUE The initial value of the field.

Street Address:
Postal City code:
Zip Code:
Password Field: INPUT TYPE=PASSWORD An INPUT element with `TYPE=PASSWORD' is a text field as above, except that the value is obscured as it is entered. Check Box: INPUT TYPE=CHECKBOX An INPUT element with `TYPE=CHECKBOX' represents a boolean choice. A set of such elements with the same name represents an n-of-many choice field. Required attributes are: NAME symbolic name for the form field corresponding to this element or group of elements. VALUE The portion of the value of the field contributed by this element. Optional attributes are: CHECKED indicates that the initial state is on. For example:

What flavors do you like? Vanilla
Strawberry
Chocolate
As many checked name/value pairs will be returned as are checked. Radio Button: INPUT TYPE=RADIO An INPUT element with `TYPE=RADIO' represents a boolean choice. Optional: CHECKED indicates that the initial state is on. Image Pixel: INPUT TYPE=IMAGE An INPUT element with `TYPE=IMAGE' specifies an image resource to display, and allows input of two form fields: the x and y coordinate of a pixel chosen from the image. The names of the fields are the name of the field with `.x' and `.y' appended. `TYPE=IMAGE' implies `TYPE=SUBMIT' processing; that is, when a pixel is chosen, the form as a whole is submitted. The NAME attribute is required as for other input fields. The SRC attribute is required and the ALIGN is optional as for the IMG element (see section Image: IMG). For example:

Choose a point on the map: Hidden Field: INPUT TYPE=HIDDEN An INPUT element with `TYPE=HIDDEN' represents a hidden field. Submit Button: INPUT TYPE=SUBMIT An INPUT element with `TYPE=SUBMIT' represents an input option, typically a button, that instructs the user agent to submit the form. Optional attributes are: NAME indicates that this element contributes a form field whose value is given by the VALUE attribute. If the NAME attribute is not present, this element does not contribute a form field. VALUE indicates a label for the input (button). You may submit this request internally:
or to the external world: Reset Button: INPUT TYPE=RESET An INPUT element with `TYPE=RESET' represents an input option, typically a button, that instructs the user agent to reset the form's fields to their initial states. The VALUE attribute, if present, indicates a label for the input (button). Selection: SELECT The SELECT element constrains the form field to an enumerated list of values. The values are given in OPTION elements. Attributes are: MULTIPLE indicates that more than one option may be included in the value. NAME specifies the name of the form field. SIZE specifies the number of visible items. Select fields of size one are typically pop-down menus, whereas select fields with size greater than one are typically lists. Option: OPTION The Option element can only occur within a Select element. It represents one choice, and has the following attributes: SELECTED Indicates that this option is initially selected. VALUE indicates the value to be returned if this option is chosen. The field value defaults to the content of the OPTION element. The content of the OPTION element is presented to the user to represent the option. It is used as a returned value if the VALUE attribute is not present. Text Area: TEXTAREA The TEXTAREA element represents a multi-line text field. Attributes are: COLS the number of visible columns to display for the text area, in characters. NAME Specifies the name of the form field. ROWS The number of visible rows to display for the text area, in characters.