Control
cfselect
cfapplet
Preserving input data with preservedata
The
attribute
cfform
entered in the form after the user submits the form. Data is preserved in the
, and
cftextinput
specify a default value for a control, and a user overrides that default in the form, the user input is
preserved.
You can retain data on the form when the form's action posts to the same ColdFusion page as the
form itself, and the control names are the same.
For example, if you save this form as preserve.cfm, it continues to display any text that you enter
after you submit it, as follows:
<cfform action="preserve.cfm" preservedata="Yes">
<p>Please enter your name:
<cfinput type="Text" name="UserName" required="Yes"><p>
<input type="Submit" name=""> <input type="RESET">
</cfform>
Usage notes for the preservedata attribute
When using the
•
In
, the
cftree
selected element. For this to work correctly, you must also set the
True.
•
The
preservedata
query, you must update the data source with the new data (typically by using
before redisplaying the grid. The grid then displays the updated database information.
Browser considerations
The applet-based controls for
JavaScript and Java to display their content. To allow them to display consistently across a variety
of browsers, these applets use the Java plug-in. As a result, they are independent of the level of
Java support provided by the browser.
ColdFusion downloads and installs the browser plug-in if necessary. Some browsers display a
single permission dialog box asking you to confirm the plug-in install. Other browsers,
particularly older versions of Netscape, require you to navigate some simple option screens.
Because the controls use JavaScript to return data to ColdFusion, if you disable JavaScript in your
browser, it cannot properly run forms that contain these controls. In that case, the controls still
display, but data return and validation does not work and you can receive a JavaScript error.
Description
Drop-down list box not a Java applet).
Equivalent to the HTML select tag with the
addition of input validation and data binding.
Embed your own Java applets in the form.
tells ColdFusion to continue displaying the data that a user
preservedata
controls and in
cftree
attribute, follow these guidelines:
preservedata
attribute causes the tree to expand the tree to the previously
preservedata
attribute has no effect on
—
cfform
controls populated by queries. If you
cfselect
. If you populate the control from a
cfgrid
,
,
cfgrid
cfslider
cftextinput
Creating forms with the cfform tag
For more information
"Building drop-down list boxes"
on page
593.
"Embedding Java applets"
on page
606.
,
cfinput
cfslider
attribute to
completePath
cfgridupdate
, and
cftree
,
)
—use
585
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers