Adobe COLDFUSION 9 Manual page 762

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Field name suffix
_cfformURL
_cfformboolean
_cfformUUID
_cfformGUID
_cfformnoblanks
_cfformmaxlength
_cfformregex,
_cfformregular_expression
_required, _cfformrequired
Hidden form field considerations
Consider the following rules and recommendations when determining whether and how to use hidden form field
validation:
• Use hidden field validation if you want to validate data from standard HTML
tags include a
cftextarea
validation.
• Consider using hidden field validation with the
rules for a single field and want to provide a separate error message for each validation.
• Do not use the suffixes listed in the table as field names.
• Adding a validation rule to a field does not make it a required field. Add a separate
ensure user entry.
Hidden form field example
The following procedure creates a simple form for entering a start date and a salary. It uses hidden fields to ensure that
you enter data and that the data is in the right format.
This example uses a self-submitting form; the same ColdFusion page is both the form page and its action page. The
page uses an
function to check that form data has been submitted. This way, the pages does not show any
IsDefined
results until you submit the input. The form uses HTML tags only; you can substitute these tags with the CFML
equivalents.
Verifies
A valid URL. Must start with http:\\, https:\, ftp:\, file:\, mailto:, or news:. Can include, as appropriate,
user name and password designators and query strings. The main part of the address can only have
the characters A-Za-z0-9 and -.
A value that can be treated as a Boolean: Yes, No, True, False, 0, 1.
A universally unique identifier (UUID) that follows the ColdFusion format, xxxxxxxx-xxxx-xxxx-
xxxxxxxxxxxxxxxx, where x is a hexadecimal number.
A unique identifier that follows the Microsoft/DCE format, xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx,
where x is a hexadecimal number.
The field must not include blanks. ColdFusion uses this validation only if you also specify a
_
required
hidden field.
The number of characters must not exceed the number specified by the tag
The data must match a JavaScript regular expression specified by the tag
Data must be entered or selected in the form field.
attribute that provides a simpler method for specifying server-side
validateAt
cfinput
Last updated 8/5/2010
tags. The
input
and
tags if you specify multiple validation
cftextarea
_required
757
value
attribute.
attribute.
value
and
cfinput
hidden field to

Advertisement

Table of Contents
loading

Table of Contents