Accessibility

Table of Contents

Introducing ColdFusion MX 7

Flash Forms

Another important enhancement to forms is less of an enhancement and more of a drop in replacement. Macromedia Flash has long been a potential replacement for HTML forms, enabling developers to leverage the capable Flash Player to deliver a better user experience. Of course, that has meant learning Flash or deploying Macromedia Flex. For ColdFusion developers who simply want better forms, there needs to be a simpler solution.

To make the creation of Flash-based forms easier for coders, ColdFusion MX 7 introduces a series of tags that make building powerful and sophisticated data-entry forms as simple as, well, ColdFusion. For example, if you need to prompt a user for a date (perhaps a date of birth), you can replace the HTML code:

<form action="" ...>
<input type="text" name="dob">
...
</form>

with the following:

<cfform format="flash" action="" ...>
<cfinput type="datefield" name="dob">
...
</cfform>

This creates a form with a text field, just like the HTML text field, except that this one displays a pop-up date chooser when a user selects the field. It's that simple. Using a combination of cfinput tags to create controls, and cfformgroup tags to group them as needed, ColdFusion developers can generate Flash forms without knowing (or even owning) Flash.

A pop-up calendar is just the start of it. Other features include the following:

  • Tree control
  • Data grid
  • Multipane forms (using tab or an accordion-style interface)
  • Input masking
  • Data binding between form controls
  • Client-side events
  • Integrated error checking and validation feedback

How does this all work? When ColdFusion processes a page containing these tags, it generates the Flash ActionScript needed to create the form and then compiles that code into a SWF file and embeds it in the page. All of that is hidden from ColdFusion developers who simply use CFML tags, just as it is already.

In other words, you can create forms that leverage the power of Flash while retaining the productivity and simplicity that has become the hallmark of ColdFusion. Stay posted to the ColdFusion Developer Center, as it will feature an article from the ColdFusion engineers who worked on Flash forms.