Validating Data - Adobe 38043740 - ColdFusion Standard - Mac Development Manual

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Not all Java applets return values. For instance, graphical widgets might not return a specific value. For this type of
applet, the method field in the ColdFusion Administrator remains empty, but you must still provide a
attribute.
You can only use one method for each applet that you register. If an applet includes more than one method that you
want to access, you can register the applet with a unique name for each additional method you want to use.
Reference a Java applet return value in your application page
1
Specify the name of the method in the Add/Registered Java Applet page of the ColdFusion Administrator.
Specify the method name in the
2
When your page executes the applet, ColdFusion creates a form variable with the name that you specified. If you do
not specify a method, ColdFusion does not create a form variable.

Validating Data

You can validate data in Adobe ColdFusion, including form data, variable data and function parameters.
About ColdFusion validation
Data validation lets you control data that is entered into an application by ensuring that the data conforms to specific
type or formatting rules. Validation techniques have the following features:
• They let you provide feedback to users so that they can immediately correct information they provide. For example,
a form can provide immediate feedback when a user enters a name in a telephone number field, or the form could
force the user to enter the number in the correct format.
• They help prevent application errors that can arise when processing invalid data. For example, a validation test can
prevent a variable that is used in a calculation from having nonnumeric data.
• They can help enhance security by preventing malicious users from providing data that takes advantage of system
security weaknesses, such as buffer overrun attacks.
ColdFusion provides several techniques to ensure that data is valid. These include techniques for validating form data
and for validating ColdFusion variables. They also include techniques for validating form data before the user submits
it to ColdFusion, or on the ColdFusion server.
When you design data validation you consider the following factors:
Whether to validate on the client's browser or on the server, and the specific server- or
The validation technique
client-side validation technique, such as whether to validate when a field loses focus or when the user submits the form.
The specific method that you use to validate the data, including the rules that you apply to test the
The validation type
data validity, such as testing for a valid telephone number.
Validation techniques
Different validation techniques apply to different ColdFusion tags or coding environments; for example, you can use
masking only in HTML and Flash format
execute; for example, on the client browser when the user submits form data, or on the server when processing data.
The following table describes the ColdFusion validation techniques:
attribute of the
name
cfapplet
tags. Validation techniques also vary in where and when they
cfinput
Last updated 1/20/2012
tag.
743
cfappletname

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents