Name

Form — an HTML input form

Availability

JavaScript 1.0 Inherits from HTMLElement

Synopsis

                  document.form_name 
                  document.forms[form_number]

Properties

Form inherits properties from HTMLElement and defines or overrides the following:

action

A read/write string (read-only in IE 3) that specifies the URL to which the form data is sent when the form is submitted. The initial value of this property is specified by the action attribute of the <form> HTML tag. Usually, this URL specifies the address as a CGI script, although it can also be a mailto: or news: address.

elements[]

An array of input elements that appear in the form. Each element is a Button, Checkbox, Hidden, Password, Radio, Reset, Select, Submit, Text, or Textarea object. See the Form.elements[] reference page.

encoding

A read/write string (read-only in IE 3) that specifies how form data is encoded for transmission when the form is submitted. The initial value of this property is specified by the enctype attribute of the <form> tag. The default value is “application/x-www-form-urlencoded”, which is sufficient for almost all purposes. Other values may sometimes be necessary. For example, a value of “text/plain” is convenient when the form is submitted by email to a mailto: URL. See CGI Programming on the World Wide Web, by Shishir Gundavaram (O’Reilly), for further information.

length

The number of elements in the form. Equivalent to elements.length.

method

A read/write string (read-only in IE 3) that specifies the ...

Get JavaScript: The Definitive Guide, Fourth 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.