MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual page 83

Developing web applications with coldfusion
Table of Contents

Advertisement

Chapter 5: Making Variables Dynamic
CFML Code
<CFIF #Form.LastName# is not "">
AND Employees.LastName LIKE
'#form.LastName#%'
</CFIF>
<CFIF #Form.Salary# is not "">
AND Employees.Salary >=
#form.Salary#
</CFIF>
<CFIF isDefined("Form.Contract") IS
"YES">
AND Employees.Contract = 'Yes'
<CFELSE>
AND Employees.Contract = 'No'
</CFIF>
Description
If the user entered anything in the
LastName text box in the form, add "AND
Employees.LastName LIKE '[what the user
entered in the LastName text box]%'" to the
SQL statement.
If the user entered anything in the Salary
text box in the form, add "AND
Employees.Salary >= [what the user
entered in the Salary text box]" to the SQL
statement.
If the user checked the Contractor check
box, get data for the employees who are
contractors, otherwise, get data for
employees who are not contractors.
57

Advertisement

Table of Contents
loading
Need help?

Need help?

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

This manual is also suitable for:

Coldfusion 4.5

Table of Contents