HTML Help & Resources
Forms
Forms are an integral part of collecting data from visitors. There are a number of methods used with forms, however, we only cover the most commonly used.
"http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<TITLE>Document Title</TITLE>
... META DATA ...
</HEAD>
<BODY>
<!-- Basic form layout -->
<FORM NAME="myform" METHOD="post" ACTION="scriptname" ENCTYPE="multipart/form-data">
<FORM NAME="myform" METHOD="post" ACTION="scriptname">
<FORM NAME="myform" ACTION="scriptname"><!-- Method of GET is assumed -->
...form input data...
</FORM>
</BODY>
</HTML>
The example at left is basic, and defines a name, action, method, and an encryption type. NAME, METHOD, and ENCTYPE are optional, but are commonly used to process most form data.
When TARGET property is set, action script will output to an inline frame or frameset.
NAME
The name property is used with client-side scripting for identification purposes, to extract the current values of user input.
METHOD
Default setting is Get. Most commonly used is Post. Get appends the user input as query to URI contained inside the Action property. Get is also limited to the length of a URL, however Post is not, and is therefore much more commonly used.
ACTION
Contains the location of the script that will process the data.
ENCTYPE
If this property is omitted, the default is URLENCODED, which means the data is set to the action script as ..input1=value1&input2=value2... When processing the uploading of files, use only multipart/form-data.
TARGET
Target property allows you to render the results of an action script inside a framed, named element.
ONSUBMIT
Using a client-side script, you can process the request to submit data, before it is sent to the action script.
ONRESET
Using a client-side script, you can process the request to reset form data.
Move on to the Next Topic - Form Input.