Adobe COLDFUSION 9 Manual page 757

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Requesting and Presenting Information
Note: You cannot force a user to type an A, X, 9, or question mark (?) character. To ensure that a pattern is all-uppercase
or all-lowercase, use the ColdFusion UCase or LCase functions in the action page.
Masking cfcalendar and datefield input
In the
tag and the Flash format
cfcalendar
format of the output. You can use uppercase or lowercase characters in the mask:
Mask
Pattern
D
Single- or double-digit day of month, such as 1 or 28
DD
Double-digit day of month, such as 01 or 28
M
Single- or double-digit month, such as 1 or 12
MM
Double-digit month, such as 01 or 12
MMM
Abbreviated month name, such as Jan or Dec
MMMM
Full month name, such as January or December
YY
Two-character year, such as 05
YYYY
Four-character year, such as 2005
E
Single-digit day of week, in the range 0 (Sunday)–6 (Saturday)
EEE
Abbreviated day of week name, such as Mon or Sun
EEEE
Full month day of week name, such as Monday or Sunday
The following pattern specifies that the Flash form sends the date selected using a
ColdFusion as text in the format 04/29/2004:
<cfinput name="startDate" type="datefield" label="date:" mask="mm/dd/yyyy"/>
Validating form data with regular expressions
You can use regular expressions to match and validate the text that users enter in
Ordinary characters are combined with special characters to define the match pattern. The validation succeeds only if
the user input matches the pattern.
Regular expressions let you check input text for a wide variety of custom conditions for which the input must follow a
specific pattern. You can concatenate simple regular expressions into complex search criteria to validate against
complex patterns, such as any of several words with different endings.
You can use ColdFusion variables and functions in regular expressions. The ColdFusion server evaluates the variables
and functions before the regular expression is evaluated. For example, you can validate against a value that you
generate dynamically from other input data or database values.
Note: The rules listed here are for JavaScript regular expressions, and apply to the regular expressions used in
and
tags only. These rules differ from the rules used by the ColdFusion functions
cftextinput
, and
REFindNoCase
REReplaceNoCase
"Using Regular Expressions in
input control, you use the following masks to determine the
datefield
. For information on regular expressions used in ColdFusion functions, see
Functions" on page 131.
Last updated 8/5/2010
input control to
datefield
and
cfinput
cftextinput
cfinput
,
REFind
REReplace
752
tags.
,

Advertisement

Table of Contents
loading

Table of Contents