Validating The Data That Users Enter In Form Fields - MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual

Developing web applications with coldfusion
Table of Contents

Advertisement

68
example, if you want the error message to read "You must enter your first name," use
the syntax:
<INPUT TYPE="hidden"
NAME="FirstName_required"
VALUE="You must enter your first name.">

Validating the Data That Users Enter in Form Fields

Another limitation of HTML forms is that you cannot validate that users input the type
or range of data you expect. ColdFusion enables you to do several types of data
validation by adding hidden fields to forms. The hidden field suffixes you can use to do
validation are as follows:
Form Field Validation Using Hidden Fields
Field Suffix
_integer
_float
_range
_date
_time
_eurodate
Note
Value Attribute
Custom error
message
Custom error
message
MIN=MinValue
MAX=MaxValue
Custom error
message
Custom error
message
Custom error
message
Adding a validation rule to a field does not make it a required field. You
need to add a separate
_required
entry.
Developing Web Applications with ColdFusion
Description
Verifies that the user enters a number. If the
user enters a floating point value, it is
rounded to an integer.
Verifies that the user enters a number. Does
not do any rounding of floating point values.
Verifies that the numeric value entered is
within the specified boundaries. You can
specify one or both of the boundaries
separated by a space.
Verifies that a date has been entered and
converts the date into the proper ODBC date
format. Will accept most common date forms,
for example, 9/1/98; Sept. 9, 1998).
Verifies that a time has been correctly entered
and converts the time to the proper ODBC
time format.
Verifies that a date has been entered in a
standard European date format and converts
into the proper ODBC date format.
hidden field if you want to ensure user

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?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents