W3cubDocs

/Haxe JavaScript

FormElement

package js.html

extends ElementDOMElementNodeEventTarget

Available on js

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 also:

Variables

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.

read onlyelements:HTMLCollection

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

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.

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.

read onlylength:Int

A long reflecting the number of controls in the form.

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.

Methods

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.

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.

reset():Void

Resets the form to its initial state.

submit():Void

Submits the form to the server.

Throws:

null

DOMError

© 2005–2020 Haxe Foundation
Licensed under a MIT license.
https://api.haxe.org/js/html/FormElement.html