FORM

Description

The Form element is used to delimit a data input form.

Syntax

<FORM
ACTION=url
CLASS=Style Sheet class name
ENCTYPE=encoding
ID=value
LANG=language
LANGUAGE=JAVASCRIPT | JSCRIPT | VBSCRIPT | VBS
METHOD=GET | POST
NAME=name
STYLE=styling
TARGET=window_name | _blank | _parent | _self | _top
TITLE=text content
event = script
>

Parameter

Description

ACTION

The ACTION attribute is a URL specifying the location to which the contents of the form data fields are submitted to elicit a response. As mentioned before, this could be simply a direction to an e-mail address, but generally, would be used to point towards some kind of server based CGI script/application that handles the forwarding of form data. If the ACTION attribute is missing, the URL of the document itself is assumed. The way data is submitted varies with the access protocol of the URL to which the form data is sent and with the values of the METHOD and ENCTYPE attributes.

CLASS

Class of the tag being defined. This is used to associate a subclassed style sheet with the tag.

ENCTYPE

Specifies the format of the data being submitted by the form.

ID

SGML identifier used as the target for hypertext links or for naming particular elements in associated style sheets. Valid ID values must begin with a letter. The underscore character, "_", may be used in the ID name. The ID should be unique throughout the scope of the document. If more than one object with the same identifier exists in a document, a collection of those named items is created that can only be referenced by ordinal position.

LANG

Specifies which language to use in ISO standard language abbreviation form.

LANGUAGE

Specifies the language the current script is written in and invokes the proper scripting engine. The default value is JAVASCRIPT.
* JAVASCRIPT, JSCRIPT The script is written in JScript.
* VBS, VBSCRIPT The script is written in VBScript.

METHOD

Indicates how the form data should be sent to the server; either GET or POST.

NAME

Specifies the name of the control, bookmark, or application.

STYLE

Inline style sheet for the tag.

TARGET

Window or frame at which to target the contents. If no frame or window exists that matches the specified target, a new window is opened for the specified link. If no target is specified, the default is "_self" for a link within the same site or "_top" if the site is external. Special target values are:
_blank Specifies to load the link into a new unnamed window.
_parent Specifies to load the link into the immediate parent of the document the link is in.
_self Specifies to load the link into the same window the link was clicked in.
_top Specifies to load the link into the full body of the current window.

TITLE

The TITLE attribute is for advisory information (unless used with a mailto: attribute). The Title attribute should provide the title of the document whose address is given by the HREF attribute. The contents of the title attribute will be displayed in a tooltip during the mouse moves on the link. Internet Explorer 4.0 (and above) is the only browser to implement this.

event

Can be one or more of these events:
onclick ;
ondblclick ;
ondragstart ;
onhelp ;
onkeydown ;
onkeypress ;
onkeyup ;
onmousedown ;
onmousemove ;
onmouseout ;
onmouseover ;
onmouseup ;
onreset ;
onselectstart ;
onsubmit

Example

<FORM ACTION="_URL_" METHOD="GET|POST" ENCTYPE="MIME type">
<p> Name:
<input type="text" name="textfield">
<br>
Password:
<input type="password" name="password">
</p>
<p>
<input type="submit" name="Submit" value="Submit">
<input type="reset" name="Reset" value="Reset">
</p>
</FORM>

The code is rendered as:

Name:
Password:

Remarks

When programming the form, all control-like elements are added to the form as named items. In addition, these items are exposed through the Item method on the form.

There can be several forms in a single document, but the Form element can not be nested. (I.e. a form can't contain another form)

This element is a block element. Both the start and end tags are required.

Related Topics

INPUT