An HTML form that collects user input.
Platform Support
| IE | Mozilla | Netscape | Opera | Safari | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|---|
Constructors
| Constructor | Action | IE | Mozilla | Netscape | Opera | Safari | ||
|---|---|---|---|---|---|---|---|---|
|
Form Constructor() : Form
Creates a new instance of a Form object.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||
Form() : FormCreates a new instance of a Form object. Returns
|
||||||||
Properties
| Property | Action | IE | Mozilla | Netscape | Opera | Safari |
|---|---|---|---|---|---|---|
|
elements
: Array
Array of all of the elements in a form.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
static onreset
: Function
Occurs when a user clicks the Reset button on a form.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
static onsubmit
: Object
Occurs when a user clicks a Submit button on a form.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
target
: Object
Window or frame where the submitted results of the form should be displayed. (e.g. "_blank", "_self")
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
action
: String
URL to send the submitted results of the form.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
Specifies how the form data should be encoded.
|
No Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
|
||||||
|
length
: Number
Number of elements on a form.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
method
: String
Specifies whether the form data is sent to the server using "get" or "post".
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
|
name
: String
Name of the form.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ |
|
||||||
Functions
| Method | Action | IE | Mozilla | Netscape | Opera | Safari | ||
|---|---|---|---|---|---|---|---|---|
|
reset() : void
Resets all of the fields on a form to their initial values.
|
Show Details | 4.0+ | 1.0+ | 3.0+ | 7.0+ | 1.0+ | ||
|
Returns
|
||||||||
|
submit() : void
Submits the form data.
|
Show Details | 3.0+ | 1.0+ | 2.0+ | 7.0+ | 1.0+ | ||
|
Returns
|
||||||||
References
Button|Checkbox|FileUpload|Hidden|Input|Password|Radio|Reset|Select|Submit|Text|Textarea|HTMLFormElement
Availability
JavaScript 1.0 Inherits from HTMLElement|W3C
