Forms in the Web

WWW-browsers can be used as user-interface for all sorts of programs. Examples are information retrieval tools for the Web itself, such as Alta Vista, multiple-choice tests, and databases and expert systems, like the services offered by real-estate agents or the dutch railways.

A form contains a number of INPUT, SELECT and TEXTAREA fields. The INPUT fields are of one of the following types:

The SELECT fields contain menu "options".

There are a number of other fields that are or were proposed at some point and that may show up in future versions of the HTML language, like RANGE, FILE, SCRIBBLE, AUDIO, and IMAGE input fields, some of which provide more of a multimedia feel to the forms interface.

As a convenience feature, forms that contain only one TEXT input field accept pressing "Enter" in the text field as a SUBMIT button press.

The TEXTAREA fields show a rectangular field in which several lines of text can be entered. (The displayed size is specified as ROWS and COLS.)

Example

The following code generates the form below:
<FORM METHOD=POST
  ACTION="course-form.cgi">
Your name:
<INPUT TYPE="text" NAME="name" SIZE="50"> <br>
Sex:
<INPUT TYPE="radio" NAME="sex" VALUE="m">m
<INPUT TYPE="radio" NAME="sex" VALUE="f">f <br>
Check here if you are a student:
<INPUT TYPE="checkbox" NAME="student"> <br>
Interest in WWW:
<SELECT NAME="interest">
<OPTION>low
<OPTION>medium
<OPTION>high
</SELECT><br>
Any comments: <br>
<TEXTAREA ROWS=5 COLS=40
       NAME="comments">
</TEXTAREA><br>
<INPUT TYPE="reset" VALUE="clear all">
<INPUT TYPE="submit" VALUE="evaluate form">

Your name:
Sex: m f
Check here if you are a student:
Interest in WWW:
Any comments:



In order to evaluate this form one needs a cgi-script, i.e. a program that runs on the WWW-server that returns an HTML document.