September 2007
Intermediate to advanced
600 pages
20h 21m
English
One solution to the proliferation of <cfif> statements in Listing 13.2 is to use the <cfparam> tag (first introduced in Chapter 9, “Programming with CFML”). The <cfparam> tag has two distinct functions:
Providing default values for variables
Performing field value validation
The difference is whether or not a default is provided. Look at this example:
<cfparam name="LoginID">
No default value is provided, and so LoginID is required, and if not present an error will be thrown.
By contrast, this next example has a default value:
<cfparam name="color" default="red">
In this example color isn’t required, and if not present, the default value of red will be used.
<cfparam> also supports one additional attribute, ...
Read now
Unlock full access