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.

Get Webmaster in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.