Form

Team-Fly    

 
Webmaster in a Nutshell, 3rd Edition
By Robert Eckstein, Stephen Spainhour
Table of Contents
Chapter 11.  JavaScript


Form Client-Side JavaScript 1.0

An HTML input form Inherits From: Element
  document  .forms[  form_number  ]  document  .forms[  form_name  ]  document  .  form_name  

Properties

The Form object defines properties for each of the attributes of the HTML <form> element, such as action, encoding, method, name , and target. In addition, it defines the following properties:

elements[ ]

A read-only array of Input objects representing the elements that appear in the form. The array can be indexed numerically , or by element name for elements that have HTML name attributes defined.

length

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

Methods

reset( )

Resets each of the input elements of the form to their default values. Returns nothing. JS 1.1.

submit( )

Submits the form, but does not trigger the onsubmit event handler. Returns nothing.

Event Handlers

onreset

Invoked just before the elements of the form are reset. Return false to prevent reset.

onsubmit

Invoked just before the form is submitted. This event handler allows form entries to be validated before being submitted. Return false to prevent submission.

See Also

Element, Input, Select, Textarea


Team-Fly    
Top


Webmaster in a Nutshell
Webmaster in a Nutshell, Third Edition
ISBN: 0596003579
EAN: 2147483647
Year: 2002
Pages: 412

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net