
745
DEVELOPING
COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Las
t
upda
te
d 8/5/2010
Note:
For more information on ColdFusion error handling, see “
Handling Errors
” on page
275.
Selecting a validation technique
The following considerations affect the validation technique that you select:
•
If you are validating form data, the techniques you use can vary depending on whether you are using HTML, Flash,
or XML forms; for example, different form types have different validation limitations.
•
Different validation techniques are appropriate for different form controls and data types.
•
Available techniques vary depending on when and where you want the data validated; on the client or the server,
when the user enters data or submits a form, or when ColdFusion processes a variable or function argument.
•
Each technique has specific features and considerations, such as the form of user feedback, feature limitations, and
so on.
•
Security issues or concerns that apply to your environment or application can affect the technique you select.
The table in the preceding section described some of the considerations (see “
Validation techniques
” on page 743). The
following table describes additional considerations for selecting a validation technique. For additional considerations
that are specific to form fields, see “
Validation type considerations
” on page 749.
IsValid function
ColdFusion variables
On the server, when
the function executes
ColdFusion tests the variable to determine
whether it follows a specified validation rule and
the function returns true or false.
For more information on using the
IsValid
function for validation, see “
Validating data with
the IsValid function and the cfparam tag
” on
page
762.
cfparam tag
ColdFusion variables
On the server, when
the tag executes
ColdFusion checks the specified variable. If the
value does not meet the validation criteria,
ColdFusion generates an expression exception.
For more information on using the
cfparam
tag
for validation, see, “
Validating data with the IsValid
function and the cfparam tag
” on page
762.
cfargument
tag
UDF and CFC function
arguments
On the server, when a
function is called or
invoked
ColdFusion checks the argument value when it is
passed to the function. If the value does not meet
the validation criteria, ColdFusion generates an
application exception.
For more information on using the
cfargument
tag, see “
Writing and Calling User-Defined
Functions
” on page
153.
Validation technique
Applies to
Where and when
performed
Description
Содержание COLDFUSION 9
Страница 1: ...Developing Applications ADOBE COLDFUSION 9...