Form HTML

A form starts with a <FORM> tag and ends with a </FORM> tag. You specify fields with one of the <INPUT>, <TEXTAREA> or <SELECT> tags, interspersed with other HTML if required. Note that you should put double quotes round any parameters if they contain white space. You can have more than one form in a Web page.

The tag <ISINDEX> provides a simple query form.

Given below are most of the available options

[] means "optional" and | means "or". Items in italics should be replaced with your data.


FORM

<FORM METHOD=GET|POST ACTION=URL>

where URL normally points to the program that you want run to receive the form data. The use of GET or POST is discussed in the main text.


INPUT

This specifies a simple text input field, a checkbox, radio button, submit button, reset-to-default button, hidden field or an image. For text, check boxes and radio buttons, you will want to put prompt text beside the input fields.

<INPUT TYPE=type NAME=name [VALUE=default] [CHECKED] [SIZE=size] [MAXSIZE=maxsize]>

where type is one of TEXT, PASSWORD, CHECKBOX, RADIO, SUBMIT, RESET, HIDDEN or IMAGE; name is your field name; default is the value initially displayed; size is the display box size; and maxsize is the maximum field length. PASSWORD fields are text but with all the characters echoed as asterisks.

For checkboxes and radio buttons no text is displayed, so follow the tag by the text that you want for the input field. The VALUE is only returned as a result. Specify CHECKED if the type is CHECKBOX and you want it initially checked.

A SUBMIT field is a button with its text given in the VALUE parameter; pressing this button completes the form and sends it off to the ACTION URL. A RESET field similarly is a button which resets all the fields to their defaults.

PC Mosaic currently does not support the IMAGE type, where the GIF file is given in a SRC=file.GIF parameter. Clicking on the image completes the form with the image name returned.


TEXTAREA

This tag specifies a multi-line text area.

<TEXTAREA NAME=name ROWS=rows COLS=cols> default contents </TEXTAREA>

where you can specify any default contents that you need.


SELECT and OPTION

This tag specifies a list box, where the users selects from one (or more) options from your given list.

<SELECT NAME=name [SIZE=rows] MULTIPLE>

Series of :

<OPTION VALUE=option [SELECTED]> text

</SELECT>

If SIZE is missed out or rows is one then a pull down box is shown; otherwise a listbox of the specified number of rows is shown. If MULTIPLE is given then more than one option may be selected.

The given text of an option is put in the list. As far as I can tell, the option VALUE is ignored, unless Mosaic has a bug. If you specify SELECTED then the option is initially selected.


Return to Web Forms