Formatting Individual Data Items - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

38
4.
View
5.
Enter data for the LastName form control and submit it.
6.
The records that match the criteria specified in the form appear in a table.
Code Review
Code
<TABLE>
<TR>
<TH>First Name</TH>
<TH>Last Name</TH>
<TH>Salary</TH>
</TR>
<CFOUTPUT QUERY="GetEmployees">
<TR>
<TD>#FirstName#</TD>
<TD>#LastName#</TD>
<TD>#Salary#</TD>
</TR>
</CFOUTPUT>
</TABLE>

Formatting Individual Data Items

You may want to format individual data items. For example, you can format the Salary
field as a monetary value.
To format the Salary using the dollar format, you use the CFML expression
DollarFormat(number)
To change the format of the Salary:
1.
Return to
2.
Change the line
in your browser.
formpage.cfm
.
in Studio.
actionpage.cfm
<TD>#Salary#</TD> to <TD>#DollarFormat(Salary)#</TD>
Developing Web Applications with ColdFusion
Description
Put data into a table.
In the first row of the table, include three
columns, with the headings: First Name, Last
Name, and Salary.
Get ready to display the results of the
GetEmployees query.
Create a new row in the table, with three
columns. For a record, put the value of the
FirstName field, the value of the LastName field,
and the value of the Salary field.
Keep getting records that matches the criteria,
and display each row in a new table row until
you run out of records.
End of table.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 4.5

Table of Contents