124
Creating Forms with the CFFORM Tag
You've already learned how to use HTML forms to gather user input. (See
Forms to Specify the Data to Retrieve" on page
the CFFORM tag to create dynamic forms in CFML. In addition to HTML control types,
you can use CFFORM to create forms that contain controls such as:
Text boxes in which you can specify the appearance such as fonts and colors
Java applet based controls, inclusing trees, sliders, and grids
Other Java applets that act as form elements
With CFFORM, you gain the advantage of access to these Java applet-based controls
without having to know the Java language, and, you don't have to juggle CFOUTPUT
tags and HTML FORM tags to reference ColdFusion variables in your forms.
In addition, most CFFORM controls offer input validation attributes you can use to
validate a user's entry, selection, or interaction. This means you don't have to write
separate CFML code specifically for input validation as you do in HTML forms.
Using HTML in a CFFORM
You can use the HTML FORM tag in combination with the CFFORM tag. ColdFusion
generates HTML forms dynamically from CFFORM tags and passes through to the
browser any HTML code it finds in the form. You can use the PASSTHROUGH attribute
of the CFFORM, CFINPUT, and CFSELECT tags to enter any HTML attributes that are
not explicitly allowed in these tags. The attribute values will be passed through to the
HTML generated by these form tags. You can also replace your existing HTML FORM
tags with CFFORM and your forms will work fine.
CFFORM controls
Forms created using CFFORM use one or more of the following controls:
CFFORM Controls
Control
CFGRID
CFSLIDER
CFINPUT
Developing Web Applications with ColdFusion
30.) This chapter shows you how to use
Description
A Java applet-based control used to create a data grid you can
populate from a query or by defining the contents of individual
cells. Grids can also be used to insert, update, and delete records
from a data source.
A Java applet-based control used to define a slider.
Used to place radio buttons, check boxes, text input boxes, and
password entry boxes.
"Using
Need help?
Do you have a question about the COLDFUSION 4.5-DEVELOPING WEB and is the answer not in the manual?
Questions and answers