Adobe ColdFusion 8

About Flash forms

ColdFusion can deliver forms to the client in Flash (SWF) file format. ColdFusion automatically generates the Flash binary from your CFML code and displays it on the client. Flash forms have the following advantages over HTML forms:

  • They are browser-independent. Flash Player works in all commonly used browsers on Windows and Macintosh systems, and in Netscape and Mozilla on Linux.
  • By default, they present a modern, visually pleasing appearance, and you can apply predefined color skins or customize the appearance with specifications similar to those in a Cascading Style Sheet (CSS).
  • They let you develop complex, multipart forms that do not require multiple pages, by using tabbed or accordion-style dialog boxes.
  • They automatically do much of the layout work for you.

Note: Flash form configuration requirements differ from ColdFusion requirements. For example, Flash forms might not work with all J2EE servers supported by ColdFusion. For more information, see Installing and Using ColdFusion.

In addition to creating Flash forms, ColdFusion lets you specify Flash format for cfcalendar, cftree, and cfgrid tags. Use these tags to embed Flash calendar choosers, trees, and grids in HTML forms, to eliminate the need to use Java applets. This chapter does not specifically discuss using Flash grids and trees in HTML forms; however, the information in this chapter about grids and trees also applies to these elements.

A Flash form example

Flash forms provide many features that help you quickly create easy-to-use, professional-looking, complex forms. The following image contains a two-tab form that shows many of these features:

This form includes the following features:

  • Each tab contains a different section of the overall form, and users can enter data on both tabs before submitting the form. This technique can eliminate the need for multiple forms on multiple HTML pages.
  • The first and last names are required fields, indicated by the red asterisks.
  • The Flash form automatically fills the e-mail field with data from the name fields, but the user can override this information.
  • When the user selects the date field, a calendar automatically opens for picking the date.

Flash form CFML differences from HTML forms

Because ColdFusion sends a Flash form to the client in SWF format, everything inside a Flash form is rendered by Flash. Rendering the form in Flash has several effects:

  • Plain text and HTML tags in the body of a Flash Form have no effect.
  • You must specify all form content inside CFML tags that support Flash forms.
  • ColdFusion provides two tags that let you take advantage of Flash features and perform tasks that you would otherwise do in HTML: you use the cfformitem tag to add text blocks and horizontal and vertical rules to your form, and you use the cfformgroup tag to structure your form.
  • Standard ColdFusion forms tags, such as cfinput and cftree, include attributes that work only with Flash forms, and attribute values that let you specify form style and behavior. These include the skin attribute with many Flash-specific style attribute values for appearance, and the bind attribute for filling a field value with data from other fields.

The reference pages for the individual tags in the CFML Reference describe the form tags and their features, indicating which attributes and values work with Flash forms. This chapter describes how you can use CFML tags to build effective Flash forms.