Ford & Mason Ltd
HOME
ABOUT
CONTACT
RESOURCES
ADVERTISING



donations support the development of
cronolog.org
and
refcards.com

next up previous contents index
Next: Defining fields Up: Fill-out Forms Previous: Fill-out Forms


The FORM element

A single form is enclosed within <FORM> and </FORM> tags. There may be a number of independent forms within a document, but forms cannot be nested. Horizontal rule tags (<HR>) are often used to set off individual forms. The syntax of the FORM element is:

  <FORM [ACTION="url"] [METHOD="method"] [ENCTYPE="type"] >
    field definitions
  </FORM>

All the attributes of the FORM element are optional and have default values.

The ACTION attribute specifies the URL of the script that will process the form and defaults to the URL of the document. This URL must use the HTTP protocol, since the method of sending data is currently only defined using this protocol.

The METHOD attribute specifies the HTTP method by which the data is sent to the server. There are two possibilities: GET or POST, defaulting to GET. The GET method appends the encoded data to the URL, sometimes causing truncation problems. The POST method sends the data as a separate stream and does not suffer from this limitation. The HTTP protocol is described in Section gif.

The ENCTYPE attribute specifies how the data is encoded. Currently there is only one possible value, x-www-form-encoded, which is also the default. Chapter gif describes how the data is encoded and how it can be decoded by server-side scripts.

Within a FORM element you can use the elements INPUT, SELECT and TEXTAREA to specify input fields, as well as the normal HTML elements described in Chapters gif and gif.

The contents of data fields are sent to the specified server when the user submits the form.


next up previous contents index
Next: Defining fields Up: Fill-out Forms Previous: Fill-out Forms

[ITCP]Spinning the Web by Andrew Ford
© 1995 International Thomson Publishing
© 2002 Andrew Ford and Ford & Mason Ltd
Note: this HTML document was generated in December 1994 directly from the LaTeX source files using LaTeX2HTML. It was formatted into our standard page layout using the Template Toolkit. The document is mainly of historical interest as obviously many of the sites mentioned have long since disappeared.

 
Copyright © 1996-2002 Ford & Mason Ltd