Form : Object

An HTML form that collects user input.

Browser/User Agent Support

IEMozillaNetscapeOperaSafari
3.0+1.0+2.0+7.0+1.0+

Constructors

ConstructorIEMozillaNetscapeOperaSafari
Creates a new instance of a Form object.
3.0+1.0+2.0+7.0+1.0+
 

Properties

PropertyIEMozillaNetscapeOperaSafari
Array of all of the elements in a form.
3.0+1.0+2.0+7.0+1.0+
 
Occurs when a user clicks the Reset button on a form.
3.0+1.0+2.0+7.0+1.0+
 
Occurs when a user clicks a Submit button on a form.
3.0+1.0+2.0+7.0+1.0+
 
Window or frame where the submitted results of the form should be displayed. (e.g. "_blank", "_self")
3.0+1.0+2.0+7.0+1.0+
 
URL to send the submitted results of the form.
3.0+1.0+2.0+7.0+1.0+
 
Specifies how the form data should be encoded.
3.0+1.0+2.0+7.0+1.0+
 
Number of elements on a form.
3.0+1.0+2.0+7.0+1.0+
 
Specifies whether the form data is sent to the server using "get" or "post".
3.0+1.0+2.0+7.0+1.0+
 
Name of the form.
3.0+1.0+2.0+7.0+1.0+
 

Methods

MethodIEMozillaNetscapeOperaSafari
Resets all of the fields on a form to their initial values.
4.0+1.0+3.0+7.0+1.0+
 
Submits the form data.
3.0+1.0+2.0+7.0+1.0+
 

References

Button | Checkbox | FileUpload | Hidden | Input | Password | Radio | Reset | Select | Submit | Text | Textarea | HTMLFormElement

Availability

JavaScript 1.0 Inherits from HTMLElement | W3C

Constructor Detail

Form Form()

Creates a new instance of a Form object.

Visibility
internal

Property Detail

Array elements - read only

Array of all of the elements in a form.

See Also

Button | Checkbox | Form | Hidden | Input | Password | Radio | Reset | Select | Submit | Text | Textarea

Availability

JavaScript 1.0 | W3C

static Function onreset

Occurs when a user clicks the Reset button on a form.

See Also

Form.onsubmit | Form.reset | EventListener | EventTarget

Availability

JavaScript 1.1

static Object onsubmit

Occurs when a user clicks a Submit button on a form.

See Also

Form.onreset | Form.submit | Event | EventListener | EventTarget

Availability

JavaScript 1.0

Object target

Window or frame where the submitted results of the form should be displayed. (e.g. "_blank", "_self")

See Also

Link.target

Availability

JavaScript 1.0 | W3C

String action

URL to send the submitted results of the form.

Availability

W3C

String encoding

Specifies how the form data should be encoded.

Number length - read only

Number of elements on a form.

Availability

W3C

String method

Specifies whether the form data is sent to the server using "get" or "post".

Availability

W3C

String name

Name of the form.

Availability

W3C

Method Detail

reset() : void

Resets all of the fields on a form to their initial values.

Availability

W3C

submit() : void

Submits the form data.

Availability

W3C