64
Developing Web Applications with ColdFusion
<INPUT TYPE="Submit" VALUE="Update Information">
</FORM>
</CFOUTPUT>
</BODY>
</HTML>
3.
Save the page. as
updatedorm.cfm
.
4.
View
updateform.cfm
in a browser.
Code Review
Code
Description
<CFQUERY NAME="GetRecordtoUpdate"
DATASOURCE="CompanyInfo">
SELECT *
FROM Employees
WHERE Employee_ID = #URL.Employee_ID#
</CFQUERY>
Query the CompanyInfo
datasource and return the records
in which the employee ID matches
what was entered in the URL.
<CFOUTPUT QUERY="GetRecordtoUpdate">
Display the results of the
GetRecordtoUpdate query.
<FORM ACTION="EmployeeUpdate.cfm" METHOD="Post">
Create a form whose variables will
be process on the
EmployeeUpdate.cfm action page.
<INPUT TYPE="Hidden" NAME="Employee_ID"
VALUE="#Employee_ID#"><BR>
Use a hidden input field to pass the
employee ID to the action page.
First Name: <INPUT TYPE="text" NAME="FirstName"
VALUE="#FirstName#"><BR>
Last Name: <INPUT TYPE="text" NAME="LastName"
VALUE="#LastName#"><BR>
Department Number: <INPUT TYPE="text"
NAME="Department_ID" VALUE="#Department_ID#"><BR>
Start Date: <INPUT TYPE="text" NAME="StartDate"
VALUE="#StartDate#"><BR>
Salary: <INPUT TYPE="text" NAME="Salary"
VALUE="#Salary#"><BR>
Contractor: <INPUT TYPE="checkbox" name="Contract"
value="Yes" checked>Yes<BR><BR>
<INPUT TYPE="Submit" VALUE="Update Information">
</FORM>
</CFOUTPUT>
Populate the fields of the update
form.
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...