Creating Forms > Creating a form

 

Creating a form

A form contains properties that are invisible to the user. The properties specify how the form will be processed

A form consists of three basic parts:

form tags, which include the URL of the CGI script that will process the form, and the method in which the data will be sent to a server
Form fields, which include text fields, menus, checkboxes, or radio buttons
For more information, see About form fields, Inserting checkboxes and radio buttons, and About lists and menus.
Submit button, which sends the data to the CGI script on the server
For more information, see Creating text form buttons, and Creating a graphical Submit button.

Note: If you attempt to insert a form object without first creating the form, you'll get a Dreamweaver message "Add form tags?" Choose Yes to have Dreamweaver create form tags for the object.

To add a form to a document:

1 In the document, place the insertion point where you want the form to appear, then do one of the following:
In the Objects panel's Forms category, select the Insert Form icon.
Choose Insert > Form.
When a form is created a dotted red outline appears in the Document window. If you don't see this outline, check that View > Visual Aids > Invisible Elements is selected.
2 In the document, click the form outline to select the form, if it isn't already selected.
3 In the Property inspector's Form Name field, type a unique name to label the form.
Naming a form makes it possible to reference or control the form with a scripting language, such as JavaScript or VBScript.
4 In the Action field, specify the path to the URL where the processing script or application that will process the form information resides, by doing one of the following:
Click the folder icon, then navigate to the appropriate folder.
Type the complete path to the folder.
If you're specifying a path to a CGI script, the path to the URL will look similar to this example:
http://www.mysite.com/cgi-bin/process.cgi
5 In the Method pop-up menu, choose the method in which the form data will be handled.
Choose POST to send the form values in the body of a message.
Choose GET to send information to the server with the submitted form values appended to the URL.
Note: Don't use the GET method with long forms. URLs are limited to 8,192 characters; if the amount of data sent is too long, data will be truncated, leading to unexpected processing results. Nor should you use GET when dealing with credit card numbers or other confidential information, as this method of passing information is not secure.
Choose Default to use the user's browser default setting for sending form data which is generally the GET method.