MACROMEDIA COLDFUSION 5-DEVELOPING Develop Manual page 117

Table of Contents

Advertisement

Dynamic SQL
Creating the input form
First, you need to create an input form, which asks for information about several
fields in the Employee table. To search for data based on only the fields the user
enters in the form, you use
To create the input form:
1
2
3
Create a new application page in ColdFusion Studio.
Enter the following code:
<html>
<head>
<title>Input form</title>
</head>
<body>
<!--- Query the Employee table to be able to populate the form --->
<cfquery name="AskEmployees" datasource="CompanyInfo">
SELECT
FirstName,
LastName,
Salary,
Contract
FROM Employee
</cfquery>
<!--- define the action page in the form tag. The form variables will
pass to this page when the form is submitted --->
<form action="getemp.cfm" method="post">
<!-- text box -->
<p>First Name: <input type="Text" name="FirstName" size="20"
maxlength="35"><br>
Last Name: <input type="Text" name="LastName" size="20"
maxlength="35"><br>
Salary: <input type="Text" name="Salary" size="10" maxlength="10">
</p>
<!-- check box -->
<p>Contractor? <input type="checkbox" name="Contract" value="Yes"
>Yes if checked
</p>
<!-- reset button -->
<input type="reset" name="ResetForm" value="Clear Form">
<!-- submit button -->
<input type="submit" name="SubmitForm" value="Submit">
</form>
</body>
</html>
Save the page as
askemp.cfm
statements in the SQL statement.
cfif
.
97

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 5-DEVELOPING and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion 5

Table of Contents