Form
Every form on a web page has a form
object. The window.document.forms[]
array stores all of a web page's form
objects.
Properties
Each type of Form
element—button
, checkbox
, FileUpload
, hidden
, password
, radio
, reset
, select
, submit
, text
, and textarea
—has its own object listing in this appendix. See each individual object for more information.
| FF, IE 4; read-only in IE 3 | Triggers a specified CGI script when a user submits the form |
Example:
if (user == "expert") { window.document.the_form.action = "expert_script.cgi"; } else { window.document.the_form.action = "basic_script.cgi"; }
If the user is considered an expert, the form is set to run expert_script.cgi
when the user submits the form.
| FF, IE 3 | Array of the elements of this form ... |
Get The Book of JavaScript, 2nd 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.