
cfform
157
In HTML format, all tags, and in Flash format the
cftree
and
cfgrid
tags, require JavaScript
support on the browser. The
cfapplet
tag and applet format
cfgrid
,
cfslider
, and
cftree
tags require the client to download a Java applet.
If you specify Flash format in the
cfform
tag, ColdFusion ignores any HTML in the form body.
You must use ColdFusion tags, such as
cfinput
, for all form controls. You can include individual
Flash format
cfgrid
and
cftree
controls in an HTML format
cfform
tag.
In Flash format, if your forms do not request sensitive data (such as credit card numbers),
consider setting the
timeout
attribute. This can prevent users from getting "The form data has
expired, Please reload this page in your browser" errors if they use the browser back button to
return to the form. For more information, see “Caching data in Flash forms” in Chapter 29,
“Caching data in Flash forms,”in
ColdFusion MX Developer’s Guide
.
Note:
In Flash format, if you do not specify
height
and
width
attributes, Flash reserves browser space
equal to the area of the browser window. If any other output follows the form, users must scroll to see
it. Therefore, if you follow a Flash form with additional output, specify the
height
and
width
values.
If attribute value text must include quotation marks, escape them by doubling them.
Using the onError attribute in Flash forms
If you use onSubmit or onBlur validation, the
onError
attribute lets you specify ActionScript
code to execute if the user tries to submit a Flash form with validation errors, as follows:
•
If you specify one or more valid Flash expressions, Flash executes the expressions.
•
If you omit the attribute, Flash displays a dialog box with all applicable error messages.
•
If you specify
onError=""
(an empty string) Flash does not display any message, but does not
submit the form.
Your ActionScript can use the errors variable to determine the fields and errors. The errors object
has the following fields:
The following example shows
cfform
tags with an
onError
attribute that selects the tab in an
accordion or tabnavigator that contains a
lastName
field with an invalid entry:
<cfform name="form1" format="flash" width="800" height="500"
onError="if (errors['lastName'] != undefined
){tabA.selectedIndex=0; _root.lastName.setFocus();}">
Field
Contents
name The
name
attribute of the control’s CFML tag.
field
The internal name used by Flash for the field. name (for example,
_level0.field1)
value
The value in the field.
message The
message
attribute of the control’s CFML tag.
Содержание 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...