O'Reilly logo

ColdFusion 9 Developer Tutorial by John Farrar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Better form coding

Forms are a big part of what developers do on web pages. We will first show how to use COOP forms and then we will show how to use the special attributes and layout features of the forms tags in COOP.

Here is a simple form that has a select list and a submit button. Some tags always require an ID, but as you can see in our sample there are tags like the submit tag that you are allowed to code without the ID attribute. Create a file called form.cfm:

<cfimport prefix="coop" taglib="/share/tags/coop"/>
<coop:coop>
<coop:form id="myForm">
<coop:selectList id="mySelect" label="Select List" data="one,two,three,four" selected="three" />
<coop:submit value="Send Selection"/>
</coop:form>
</coop:coop>

The form tag, like most COOP element ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required