Share this Page URL
Help

Hour 19. Introduction to Scripts: Sendin... > Receiving Information from a Form - Pg. 325

Introduction to Scripts: Sending and Reacting to Form Data 325 Better Form Validation The Validate Form behavior offers rudimentary form validation. There are other validation behaviors that offer more choices--validating form objects other than just text fields, for instance--and that are available free on the Macromedia Exchange. Hour 22, "Customizing Dreamweaver," explains how you can download and install third-party extensions to Dreamweaver. One I particularly like is called Check Form, created by Jaro von Flocken (see www.yaromat.com/dw). Receiving Information from a Form The standard way to process a form is to have an application on the server that parses the data and performs an action on it. Parsing data is the act of dividing and interpreting the name-value pairs that are sent to the server. Each name-value pair contains the name of the form element entered in Dream weaver and the value that the user has entered or selected for that field. A text field has a name-value pair that contains the name of the text field and the value that was entered into the text field. A radio button group sends a name-value pair with the name of the radio button group and the value of the button that was selected when the user submitted the form. A list or a drop-down menu sends the name of the object and any items the user selected. The name-value pairs are sent to a server via an HTTP request from the web browser. The request is passed by the web server software to the application server that handles the scripting language specified in the request, as shown in Figure 19.3. For instance, if the script is written in ColdFusion Markup Language (CFML), the ColdFusion application server handles the request. Depending on what is written in the script, the application server might request data from a database or send a