Accessibility

ColdFusion Article

 

Creating Better Forms Faster with ColdFusion MX 7


Mike Nimer

Mike Nimer

Sr. Engineer

Table of Contents

Created:
21 February 2005
User Level:
Intermediate, Advanced

When the ColdFusion engineering team started planning ColdFusion MX 7, we finally had time to give the cfform tags some love. We talked to and heard from many customers and knew that we needed to do a cfform tag overhaul for HTML-based forms. We also knew that that if it was possible, we wanted to help ColdFusion developers harness the richness of Macromedia Flash Player and open up the cfform tag to the incredible flexibility of XForms. We knew that if we could accomplish all of this with a simple and easy cfform tag syntax, it would be a big win for you, the developer, and your application users.

Originally, ColdFusion cfform support was just a few tags that generated some basic JavaScript validation—validation that certainly had its critics. This all changed with ColdFusion MX 7. We decided it was time to throw out the tedious approach of creating forms and breathe some new life into the cfform tag.

First we had to review the enhancement requests and bug reports for the current cfform tag to make it do what you have wanted and needed it to do since we introduced it. To achieve this, we had to rewrite old tags from scratch, update validation, add new tags, and fix a few bugs (OK, fix a lot of bugs).

After making a solid foundation, we rethought the cfform tag functionality altogether. Although this was the second step in our development process, we started this step years ago. When the merger between Allaire and Macromedia occurred, there was a lot of talk about generating Flash from ColdFusion—specifically forms. During the development of ColdFusion MX 6, there were numerous "what if" discussions about the benefits of being able to use layout managers with HTML forms, which is similar to defining forms in Java Swing applications. However, it wasn't until ColdFusion MX 7 that we were able to spend the time to do this right.

Updating the cfform Tag

As with all product development, you must start with evaluating the foundation. Thus, before we could add all sorts of cool new features to the form tags, we needed to make the foundation rock-solid. We spent the first cycle of development upgrading the cfform tags. What did this involve?

You may not know this, but some ColdFusion tags are not written in Java; they are actually written in CFML for use in your CFML pages, just like the ColdFusion custom tags you write yourself. However, the way ColdFusion custom tags associate with their parent wasn't flexible enough for the plans we had for adding XML and Flash forms support to the form tags. So, the first step was to rewrite these tags from scratch as Java tags, while at the same time adding all of the missing HTML tags that the cfform tags didn't generate. Personally I always hated that I could use cfinput to define a text field but not a submit button. One of the joys of being both a user and developer of the product: I can fix my own pet peeves.

Once we finished rewriting the new tags, we dug through the bug tracker. We knew there were numerous enhancement requests for the cfform tag that customers frequently requested through mailing lists and forums. To ensure that we didn't miss anything, we searched for all open bugs and enhancement requests submitted all the way back to ColdFusion 3 and then transferred them into the ColdFusion MX 7 queue. While reviewing all of these requests, we still decided to defer or close some of the bugs and enhancements, but we wanted to ensure that we evaluated every single open bug and enhancement. By the way, this was a common task for most of the ColdFusion MX 7 features (not just the cfform tags).

About the author

Mike Nimer is a senior engineer on the ColdFusion engineering team, responsible for features such as the Rich Forms in ColdFusion 7 and the Administrator API. Before joining the engineering team, Mike Nimer spent three years working as a senior consultant with Allaire and then Macromedia consulting group, providing on-site assistance to customers with their architecture planning, code reviews, performance tuning, and general fire fighting.