MACROMEDIA COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION MX Getting Started page 112

Building coldfusion mx applications
Table of Contents

Advertisement

Note: You have already entered validation code for business rule 1. Validation code for business rule
10 is described in more detail later in this lesson.
Rule Description
2
All trips must be accompanied
by a full description.
3
Each trip must be categorized
by event type. Only valid event
types (1-surfing, 2-mountain
climbing, and so on) are
permissible.
4
Trip locations are required.
5
The maximum number of
people permitted on the trip
must be specified.
6
The trip departure and return
dates must be specified for
each trip.
All trip dates must be valid
future dates. Departure date
must precede return date.
112
Chapter 10: Lesson 7: Validating Data to Enforce Business Rules
Validation code
<!--- Trip description is required. --->
<cfif Form.tripDescription EQ "">
<cfset IsOk = "No">
<cfoutput>
Trip description cannot be blank.
</cfoutput>
</cfif>
Because event type 1 (surfing) is selected by default, there is
always a value for event type.
<!--- Trip location is required. --->
<cfif Form.tripLocation EQ "">
<cfset IsOk = "No">
<cfoutput>
Trip location cannot be blank.
</cfoutput>
</cfif>
<!--- Number of people is required and must be
numeric. --->
<cfif Form.numberPeople EQ "" or
IsNumeric(Form.numberPeople) EQ False>
<cfset IsOk = "No">
<cfoutput>
The number of people must be a number and
cannot be blank.
</cfoutput>
</cfif>
<cfif form.departureDate GT form.returnDate>
<cfset isOk = "No">
<cfoutput>
Departure date cannot precede return date.
Please re-enter.
</cfoutput>
</cfif>

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLFUSION MX 7-GETTING STARTED BUILDING COLDFUSION MX and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Colfusion mx 7 - installing and using coldfusion mx

Table of Contents