|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Creating Forms with the CFFORM Tag
|
|
|
|
The CFFORM tag allows you to create dynamic forms in CFML and gives you access to a wide range of form controls, such as Java applet-based tree, slider, and grid controls, as well as the standard HTML control types like check boxes, radio buttons, text input boxes, and edit boxes. 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.
Forms created using the CFFORM tags are structured just as HTML forms. Within the <CFFORM> and </CFFORM> tags, you place entries for form controls, such as check boxes and radio buttons (using CFINPUT), data grids (using CFGRID), tree controls (CFTREE), or drop-down lists and select boxes (CFSELECT).
The HTML Reference contains complete online information on the HTML FORM tag. You can open it from the Window Start menu by clicking Welcome to ColdFusion and then selecting it from the Documentation list. You can also open it from the ColdFusion Studio Help References.
|
|
|
|
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 also replace your existing HTML FORM tags with ColdFusion CFFORM and your forms will work fine.
|
|
|
|
Advantages of Using Dynamic Forms
|
|
|
Building a form with CFFORM provides the following advantages over building a form using just HTML:
- You no longer have to juggle CFOUTPUT sections and HTML FORM tags in order to use ColdFusion expressions. Expressions can be used directly in tags inside a CFFORM.
- CFFORM elements include a number of Java applet-based controls you can use immediately without having to learn about Java. These dynamic controls add tremendous power to forms.
- Most CFFORM controls offer input validation attributes you can use to validate a user's entry, selection, or interaction. Input validation is often done with JavaScript. You can reference JavaScript programs in your CFFORM.
- Using CFAPPLET, you can simplify the job of embedding custom Java applets of your own in your CFFORM.
For nearly all CFFORM controls, you can specify font characteristics, alignment, size, scrolling properties, as well as a number of other options.
|
|
|
|
CFFORM controls |
|
|
|
When you build a form using CFFORM, you typically use one or more of the following controls:
- CFGRID -- 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.
- CFSLIDER -- A Java applet-based control used to define a slider.
- CFINPUT -- Used to place radio buttons, check boxes, or text input boxes.
- CFTREE and CFTREEITEM -- More Java applet-based controls used to define a tree control and individual tree control items.
- CFTEXTINPUT -- A Java applet-based control used to define a text input box.
- CFSELECT -- Used to define a drop-down list box.
- CFAPPLET -- Allows you to embed your own Java applets.
|
|
|
|
Improving performance with ENABLECAB |
|
|
|
The CFFORM ENABLECAB attribute allows you to improve the performance of Java-applet based CFFORM controls. When you use ENABLECAB, ColdFusion prompts the end user to accept a download of the Java classes needed for the CFFORM controls that use them. CAB files are digitally signed using VeriSign digital IDs to ensure file security.
|
|
|
|
Note
|
|
|
The ENABLECAB attribute is supported only for MS Internet Explorer clients that have Authenticode 2.0 installed. Authenticode 2.0 can be downloaded from http://www.microsoft.com/ie/security/authent2.htm.
|
|
|
|
Browsers that disable Java |
|
|
|
Since each of the Java applet-based controls, CFGRID, CFSLIDER, CFTEXTINPUT, and CFTREE require a Java applet to run, browsers that do not support Java or that have disabled Java execution will not execute the forms that contain these controls. Using the NOTSUPPORTED attribute, ColdFusion allows you to present an error message rather than the blank applet space that appears in the browser. This attribute is available in each of the Java applet-based controls as well as the CFAPPLET tag. You use NOTSUPPORTED to specify the message you want to appear, formatted as HTML, when an application page is loaded by a browser that does not support Java.
|
|
|
  
|
|
|
AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.
|
|