Macromedia dreamweaver 8-using dreamweaver User Manual
Collecting data submitted by users
675
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. If
you set the form’s method attribute to POST, the browser includes the form’s values in the
body of the message sent to the server. If you set the form’s method attribute to GET, the
browser appends the form values to the URL specified in the action attribute and sends the
information to the server.
you set the form’s method attribute to POST, the browser includes the form’s values in the
body of the message sent to the server. If you set the form’s method attribute to GET, the
browser appends the form values to the URL specified in the action attribute and sends the
information to the server.
Hypertext links
also 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.
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.
This section describes how to create form and URL parameters for use in web applications.
Form parameters
Form parameters are sent to the server using an HTML form using either the
POST
or
GET
method. When using the
POST
method, parameters are sent in the body of the message. In
contrast, the
GET
method appends parameters to the requested URL.
You can use Dreamweaver to quickly design HTML forms that send form parameters to the
server. For instructions, see
server. For instructions, see
. 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
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
In cases where a web application expects a precise parameter value (for example, when it
performs an action based on one of several options), use a radio button, checkbox, or list/
menu form object to control the possible values the user can submit. This prevents users from
typing information incorrectly and causing an application error. The example below depicts a
pop-up menu form offering three choices:
performs an action based on one of several options), use a radio button, checkbox, or list/
menu form object to control the possible values the user can submit. This prevents users from
typing information incorrectly and causing an application error. The example below depicts a
pop-up menu form offering three choices: