28
Chapter 2: CFML Basics
The output of this
cfif
statement is based on the value entered by the user. If the user enters MA
in the state form field, the state tax results returned is 8.5%. If the user enters VA in the state
form field, the state tax results returned is 8.2%. If the user enters any other state in the state form
field, State Tax Unknown is returned.
Processing form data
Virtually all web applications that gather and write information to a database use a form to
accomplish that task. Forms let you collect information from a user (using an order form,
registration form, and so on) and write that information to a database. Like HTML, there are two
independent steps for creating a form in ColdFusion:
1
Creating the layout for the form itself.
2
Writing the code to process the submitted information.
Form processing
Every form that you create in ColdFusion consist of two parts: the form page and the action
page.These two pages work together to process user input. The
form page
contains the user
interface elements, such as input fields, and radio buttons. The
action page
handles the processing
of the form page data.
When a user submits a form, the form values are stored in form variables and sent to the action
page for processing. The following figure shows the relationship between the form page and
action page:
Name
Submit
Database
form.var1=value1
form.var2=value2
Action
page
The action page contains
the code for form processing
and interaction with
database.
ColdFusion server &
web server
Form page
Содержание COLDFUSION MX 61-GETTING STARTED BUILDING COLDFUSION...
Страница 1: ...Getting Started Building ColdFusion MX Applications...
Страница 6: ...6 Contents...
Страница 10: ......
Страница 30: ...30 Chapter 2 CFML Basics...
Страница 36: ...36 Chapter 3 Database Fundamentals...
Страница 48: ......
Страница 76: ...76 Chapter 6 Lesson 2 Writing Your First ColdFusion Application...
Страница 134: ...134 Index...