Graphics Programs Reference
In-Depth Information
Setting Form Attributes
After you add a form to a page, you can adjust the form attributes in the Property inspec-
tor when the form is selected. You must set all of the form attributes except the Target
attribute, which is optional. Form attributes include:
Form ID. A unique name for the form. The form ID enables the form to be referenced
or controlled with a scripting language. If you do not name the form, Dreamweaver
generates a name. A form ID can include alphanumeric characters, spaces, under-
scores, and dashes, but cannot begin with a number.
Action. The path to the location of the script you will use to process the form data.
You must install the script or create the page in the desired location prior to setting the
Action. You can also type “mailto:” followed by an e-mail address in the Action box
to send the form information to a specifi ed e-mail address (the mailto: link works only
if the user is on a computer confi gured to send e-mail), or you can type the name of a
JavaScript function in the Action box if you are using JavaScript to process the form.
Method. The way form data will be sent to the location specifi ed in the Action box.
POST embeds form data in an HTTP request. When you use the POST method, the
form data is not visible. POST is the preferred method for most forms. GET appends the
form data to the end of the path specifi ed in the Action box. When you use the GET
method, form data is limited to 8,192 characters of information and is visible because
it is added to the end of the URL. GET is frequently used for search engine requests.
Default uses the browser default of the user's browser to send form data. The script or
application you use to process form data might affect the method that you will need to
use to send the form data.
Target. The target destination for any response from the form. For example, if the script
attached to the form sends a response to the user such as “We have received your
information.” that response appears in the target destination. Target options are the
usual _blank, _parent, _self, and _top.
Enctype (encoding type). The Multipurpose Internet Mail Extensions encoding type
(MIME type) for the form data. The MIME type is a fi le identifi cation based on the
MIME encoding system, which is the standard for identifying content on the Internet.
Most forms use the application/x-www-form-urlencoded MIME type. The multipart/
form-data MIME type is used for uploading fi les, such as when you use a fi le-upload
fi eld in a form.
You'll set each of these attributes for the form in the contact.html page.
To set up the form in the contact.html page:
1. Copy the form_test.html file located in the Tutorial.06\Tutorial folder included
with your Data Files, and then paste it into the site's local root folder. This Web
page contains a script that will let you test the form by displaying the data the
form will send to the server when the Submit button is clicked.
2. In the contact.html page, click the red dotted line to select the form. The form
attributes appear in the Property inspector.
3. In the Form ID box, type contact . This is the unique name for the form.
4. In the Action box, type form_test.html . The action will eventually point to a script
placed on the server to process the form data. While the programming team is
writing the script, the action points to the test script Web page you copied into
the local root folder.
5. Click the Method arrow, and then click GET . The form data will be appended to
the end of the path specified in the Action box.
6. Click the Enctype arrow, and then click application/x-www-form-urlencoded .
Search WWH ::

Custom Search