Form object
Object. Lets users input text and make choices from Form elements such as checkboxes, radio buttons, and selection lists. You can also use a form to post data to a server.
HTML syntax
To define a form, use standard HTML syntax with the addition of JavaScript event handlers:
<FORM
NAME="formName"
TARGET="windowName"
ACTION="serverURL"
METHOD=GET | POST
ENCTYPE="encodingType"
[onReset="handlerText"]
[onSubmit="handlerText"]>
</FORM>
HTML attributes
NAME="formName" specifies the name of the Form object. You can access this value using the name property, and you can use this name when indexing the forms array.
TARGET="windowName" specifies the window that form responses go to. When you submit a form with a TARGET attribute, server responses are displayed in the specified window instead of the window that contains the form. windowName can be an existing window; it can be a frame name specified in a <FRAMESET> tag; or it can be one of the literal frame names _top, _parent, _self, or _blank; it cannot be a JavaScript expression (for example, it cannot be parent.frameName or windowName.frameName). You can access this value using the target property.
ACTION="serverURL" specifies the URL of the server to which form field input information is sent. This attribute can specify a CGI or LiveWire application on the server; it can also be a mailto: URL if the form is to be mailed. See the location object for a description of the URL components. You can access this value using the action property.
METHOD=GET | POST specifies how information is sent to the server specified by ACTION. GET (the default) appends the input information to the URL, which on most receiving systems becomes the value of the environment variable QUERY_STRING. POST sends the input information in a data body, which is available on stdin with the data length set in the environment variable CONTENT_LENGTH. If the METHOD attribute has the value "POST," then the ENCTYPE attribute typically has the value "application/x-www-form-urlencoded." You can access this value using the method property.
ENCTYPE="encodingType" specifies the MIME encoding of the data sent: "application/x-www-form-urlencoded" (the default) or "multipart/form-data." Use "multipart/form-data" if the form contains a file upload element (INPUT TYPE="file"). If the METHOD attribute has the value "POST," then the ENCTYPE attribute typically has the value "application/x-www-form-urlencoded." You can access this value using the encoding property.
Syntax
To use a Form object's properties and methods:
1. formName.propertyName
2. formName.methodName(parameters)
3. forms[index].propertyName
4. forms[index].methodName(parameters)