Operation Manual
623
Last updated 3/28/2012
Chapter 22: Building forms
When a visitor enters information into a web form displayed in a web browser and clicks the submit button, the
information is sent to a server where a server-side script or application processes it. The server responds by sending
the processed information back to the user (or client), or by performing some other action based on the form’s
contents.
You can use Dreamweaver to create forms that submit data to most application servers, including PHP, ASP, and
ColdFusion. If you use ColdFusion, you can also add ColdFusion-specific form controls to your forms. Your forms
can have text fields, password fields, radio buttons, check boxes, pop-up menus, clickable buttons, and other form
objects. Dreamweaver can also write code that validates the information a visitor provides. For example, you can check
that an e-mail address that a user enters contains an “@” symbol, or that a required text field contains a value.
Using forms to collect information from users
About collecting information from users
You can use web forms or hypertext links to gather information from users, store that information in the server’s
memory, and then use the information to create a dynamic response based on the user’s input. The most common
tools for gathering user information are HTML forms and hypertext links.
HTML forms Let you gather information from users and store it in the server’s memory. An HTML form can send the
information either as form parameters or as URL parameters.
Hypertext links Let you gather information from users and store it in the server’s memory. You specify a value (or
values) to be submitted when a user clicks a link—a preference, for example—by appending the value to the URL
specified in the anchor tag. When a user clicks the link, the browser sends the URL and the appended value to the
server.
HTML form parameters
Form parameters are sent to the server by means of an HTML form using either the POST or GET method.
When using the POST method, parameters are sent to the web server as part of the document's header, and are not
visible or accessible to anyone who's viewing the page using standard methods. The
POST method should be used for
values that affect database content (for example inserting, updating, or deleting records), or for values that are sent by
email.
The GET method appends parameters to the requested URL. The parameters are in turn visible to anyone viewing the
page. The
GET method should be used for search forms.
You can use Dreamweaver to quickly design HTML forms that send form parameters to the server. Be aware of the
method you use to transmit information from the browser to the server.
Form parameters take the names of their corresponding form objects. For example, if your form contains a text field
named
txtLastName, then the following form parameter is sent to the server when the user clicks the Submit button:
txtLastName=enteredvalue