HTML DOM Form object
The Form object
The Form object represents an HTML form.
The Form object is created every time it appears in an HTML document.
Form users are typically used to collect user data and contain input elements such as: text fields, check boxes, check boxes, single boxes, submit buttons to wait. Forms can also say options menus, textarea, fieldset, legend, and label elements.
Forms are used to send data to the service side.
Form object collection
W3C: W3C standard.
gather | describe | W3C |
---|---|---|
elements[] | Contains an array of all elements in the form. | Yes |
The Form object property
Attributes | describe | W3C |
---|---|---|
acceptCharset | The server acceptable character set. | Yes |
action | Set or return the action attribute of the form. | Yes |
enctype | Set or return to the MIME type for encoding the content. | Yes |
length | Returns the number of elements in the form. | Yes |
method | Set or returns the HTTP method to send data to the server. | Yes |
name | Set or return the name of the form. | Yes |
target | Set or return the Frame or Window name of the form submission result. | Yes |
The Form object method
method | describe | W3C |
---|---|---|
reset() | Reset a form | Yes |
submit() | Submit a form | Yes |
The Form object event
event | describe | W3C |
---|---|---|
onreset | Call before resetting the form element. | Yes |
onsubmit | Call before submitting the form. | Yes |
Standard properties and events
The Form object also supports the standard properties and events.