FormElement

EventTargetNodeDOMElementElementjs.html.FormElement (extern class)

The HTMLFormElement interface represents a form element in the DOM; it allows access to and in some cases modification of aspects of the form, as well as access to its component elements.

Documentation HTMLFormElement by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Instance Members

acceptCharset: String

A DOMString reflecting the value of the form's accept-charset HTML attribute, representing the character encoding that the server accepts.


action: String

A DOMString reflecting the value of the form's action HTML attribute, containing the URI of a program that processes the information submitted by the form.


autocomplete: String

A DOMString reflecting the value of the form's autocomplete HTML attribute, indicating whether the controls in this form can have their values automatically populated by the browser.


enctype: String

A DOMString reflecting the value of the form's enctype HTML attribute, indicating the type of content that is used to transmit the form to the server. Only specified values can be set. The two properties are synonyms.


encoding: String

A DOMString reflecting the value of the form's enctype HTML attribute, indicating the type of content that is used to transmit the form to the server. Only specified values can be set. The two properties are synonyms.


method: String

A DOMString reflecting the value of the form's method HTML attribute, indicating the HTTP method used to submit the form. Only specified values can be set.


name: String

A DOMString reflecting the value of the form's name HTML attribute, containing the name of the form.


noValidate: Bool

A Boolean reflecting the value of the form's  novalidate HTML attribute, indicating whether the form should not be validated.


target: String

A DOMString reflecting the value of the form's target HTML attribute, indicating where to display the results received from submitting the form.


elements: HTMLCollection

A HTMLFormControlsCollection holding all form controls belonging to this form element.


length: Int

A long reflecting  the number of controls in the form.


submit(): Void

Submits the form to the server.


reset(): Void

Resets the form to its initial state.


checkValidity(): Bool

Returns true if the element's child controls are subject to constraint validation and satisfy those contraints; returns false if some controls do not satisfy their constraints. Fires an event named invalid at any control that does not satisfy its constraints; such controls are considered invalid if the event is not canceled. It is up to the programmer to decide how to respond to false.

Returns
Bool

reportValidity(): Bool

Returns true if the element's child controls satisfy their validation constraints. When false is returned, cancelable invalid events are fired for each invalid child and validation problems are reported to the user.

Returns
Bool