Help Center

Local Navigation

Object: HTMLFormElement

Availability

BlackBerry® Device Software version 4.6 or later

Extends

HTMLElement

The HTMLFormElement object represents a <form> element in an HTML document.

The <form> element specifies a form that gathers information from the user. Users can submit a form by using the <submit> input element. After a submission, the form collects the names and values of enclosed <select>, <input>, and <textarea> elements and submits the query as part of the request (GET) or as post data (POST).

HTMLFormElement properties

Property name

Type

Description

Status

Support level

Availability

acceptCharset

DOMString

Specifies a list of valid character sets for form data.

writable

DOM 2 HTML

4.6 or later

action

DOMString

Specifies a URI to which the form is submitted.

writable

DOM 2 HTML

4.6 or later

elements

HTMLCollection

Returns an index of the form control elements contained within the form. Index positions begin at 0 and continue to HTMLCollection.length-1.

Image buttons (<input> elements for which type="image") are excluded from the collection.

read only

DOM 2 HTML

4.6 or later

enctype

DOMString

Specifies the content type the form data is encoded with.

writable

DOM 2 HTML

4.6 or later

length

int

Returns the number of form control elements contained within the form.

read only

DOM 2 HTML

4.6 or later

method

DOMString

Specifies the HTTP method used to send the data to the server.

writable

DOM 2 HTML

4.6 or later

name

DOMString

Specifies a unique name for the form.

read only

DOM 2 HTML

4.6 or later

target

DOMString

Specifies where the target document is opened.

writable

DOM 2 HTML

4.6 or later

HTMLFormElement methods

Method name

Description

Support level

Availability

reset()

Restores the default values to the form element.

DOM 2 HTML

4.6 or later

submit()

Submits the current values of the form element.

DOM 2 HTML

4.6 or later


Was this information helpful? Send us your comments.