Name
Form — an HTML input form
Availability
Client-side JavaScript 1.0
Inherits From
HTMLElement
Synopsis
document.form_name
document.forms[form_number]Properties
Form inherits properties from HTMLElement and also defines or overrides the following:
- action
The URL for form submission. JavaScript 1.0; read-only in Internet Explorer 3.
- elements[]
The input elements of the form.
- elements.length
The number of elements in a form.
- encoding
The encoding of form data. JavaScript 1.0; read-only in Internet Explorer 3.
- length
The number of elements in a form.
- method
The submission method for the form. JavaScript 1.0; read-only in Internet Explorer 3.
- name
The name of a form.
- target
The window for form results. JavaScript 1.0; read-only in Internet Explorer 3.
Methods
Form inherits methods from HTMLElement and also defines the following:
- reset()
Reset the elements of a form. JavaScript 1.1.
- submit()
Submit a form.
Event Handlers
Form inherits event handlers from HTMLElement and also defines the following:
- onreset
The handler invoked when a form is reset. JavaScript 1.1.
- onsubmit
Invoked when a form is submitted.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access