38
Developing Web Applications with ColdFusion
4.
View
formpage.cfm
in your browser.
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
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
actionpage.cfm
in Studio.
2.
Change the line
<TD>#Salary#</TD> to <TD>#DollarFormat(Salary)#</TD>
Code
Description
<TABLE>
Put data into a table.
<TR>
<TH>First Name</TH>
<TH>Last Name</TH>
<TH>Salary</TH>
</TR>
In the first row of the table, include three
columns, with the headings: First Name, Last
Name, and Salary.
<CFOUTPUT QUERY="GetEmployees">
Get ready to display the results of the
GetEmployees query.
<TR>
<TD>#FirstName#</TD>
<TD>#LastName#</TD>
<TD>#Salary#</TD>
</TR>
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.
</CFOUTPUT>
Keep getting records that matches the criteria,
and display each row in a new table row until
you run out of records.
</TABLE>
End of table.
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...