
250
Chapter 2: ColdFusion Tags
The following pattern enforces entry of a part number of the format EB-1234-c1-098765, where
the user starts the entry by typing the first numeric character, such as 3. ColdFusion fills in the
preceding EA prefix and all - characters. The user must enters four numbers, followed by two
alphanumeric characters, followed by six numbers.
<cfinput type="text" name="newPart" mask="EB-9999-XX-999999" />
Note:
To force a pattern to be all-uppercase or all-lowercase, use the ColdFusion
UCase
or
LCase
functions in the action page.
For tags with
type="datefield"
(and
cfcalendar
tags), the number of pattern characters
determines the format of the output, as follows:
The following pattern specifies that the Flash forms sends the date selected using a
datefield
input control to ColdFusion as text in the format 04/29/2004:
<cfinput name="startDate" type="datefield" label="date:" mask="mm/dd/yyyy"/>
Flash form data binding
The
bind
attribute lets you populate form fields using the contents of other form fields. To
specify text from another field in a
cftextarea
bind
attribute, use the following format:
{
sourceTagName
.text}
For example, the following line uses the values from the firstName and lastName fields to
construct an email address. (The user can change or replace this value with a typed entry.)
<cfinput type="text" name="email" label="email"
bind="{firstName.text}.{lastName.text}@mm.com">
Example
<!--- This example shows the use of cfinput within a cfform to ensure simple
validation of text items. --->
<cfform action = "cfinput.cfm">
<!--- Phone number validation. --->
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, such as 1 or 7
EEE
Abbreviated day of week name, such as Mon or Sun
EEEE
Full month day of week name, such as Monday or Sunday
Содержание COLFUSION MX 7-CFML
Страница 1: ...COLDFUSION MX7 CFML Reference...
Страница 20: ...20 Chapter 1 Reserved Words and Variables...
Страница 50: ...50 Chapter 2 ColdFusion Tags cfelse br Searching cfif cfloop cfif...
Страница 101: ...cfdefaultcase 101 cfdefaultcase cfswitch cfoutput Your grade is grade cfoutput...
Страница 115: ...cfdocumentsection 115 cfdocumentsection cfoutput cfdocument...
Страница 311: ...cfNTauthenticate 311 Please Try again H2 cfif cfoutput cfinclude template loginform cfm cfabort cfif cfif cflogin...
Страница 411: ...cftable 411 cftable body html...
Страница 515: ...Chr 515 maxlength 5 p input type Submit name input type RESET cfform...
Страница 605: ...GetEncoding 605 WriteOutput The encoding is theEncoding cfscript cfif...
Страница 629: ...GetProfileString 629 tr td input type Submit name Submit value Submit td td td tr table form...
Страница 655: ...IIf 655 cfoutput IIf Hour Now GTE 12 DE It is afternoon or evening DE It is morning cfoutput b...
Страница 664: ...664 Chapter 3 ColdFusion Functions cfelse h3 Conversion error h3 cfif...
Страница 687: ...IsStruct 687 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Страница 693: ...IsWDDX 693 struct data wddxPacket hr xmp cfoutput packet xmp IsWDDX returns IsWDDX packet br cfoutput...
Страница 751: ...LSDateFormat 751 hr noshade cfoutput cfloop...
Страница 861: ...StructFind 861 cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Страница 869: ...StructIsEmpty 869 cfoutput cfquery cfif cfoutput hr Employee Add Complete cfoutput cfcase cfswitch...
Страница 903: ...Val 903 value Is the beginning numeric name form...
Страница 932: ...932 Chapter 3 ColdFusion Functions...
Страница 944: ...944 Chapter 4 ColdFusion MX Flash Form Style Reference...
Страница 962: ...962 Chapter 5 Application CFC Reference...
Страница 1008: ...1008 Chapter 6 ColdFusion MX Event Gateway Reference cfset retValue Reason reason cfreturn retValue cffunction...
Страница 1054: ...1054 Chapter 6 ColdFusion MX Event Gateway Reference...