Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 717

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Code
<tr>
<td>#FirstName#</td>
<td>#LastName#</td>
<td>#Salary#</td>
</tr>
</cfoutput>
</table>
Formatting individual data items
You can format individual data items. For example, you can format the salary data as monetary values. To format the
salary data using the dollar format, you use the CFML function
Change the format of the Salary
Open the file actionpage.cfm in your editor.
1
Change the following line:
2
<td>#Salary#</td>
to
<td>#DollarFormat(Salary)#</td>
Save the page.
3
Building flexible search interfaces
One option with forms is to build a search based on the form data. For example, you could use form data as part of the
WHERE clause to construct a database query.
To give users the option to enter multiple search criteria in a form, you can wrap conditional logic around a SQL AND
clause as part of the WHERE clause. The following action page allows users to search for employees by department,
last name, or both.
Note: ColdFusion provides the Verity search utility that you can also use to perform a search. For more information, see
"Building a Search
Interface" on page 476.
Build a more flexible search interface
1
Open the ColdFusion actionpage.cfm page in your editor.
Modify the page so that it appears as follows:
2
Description
For each record in the query, creates a row in the table, with three columns that
display the values of the FirstName, LastName, and Salary fields of the record.
Ends the output region.
Ends the table.
DollarFormat
Last updated 1/20/2012
.
712

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents