View comments | RSS feed

Binding data in Flash forms

The bind attribute lets you set the value of the fields using the contents of other form fields. You can use the bind attribute with the cftextarea tag and any cfinput type that takes a value, including hidden. This data binding occurs dynamically as the user enters data within Flash on the client system. Flash does not send any information to ColdFusion until the user submits the form. To use the bind attribute to specify the field value, use the following formats:

Data source bind attribute format

cfinput type = "text" or cftextarea text

bind="{sourceName.text}"

cfinput selected radio button

bind="{sourceName.selectedData}"

cftree selected item

bind="{sourceName.selectedNode.getProperty('data').value}

cfgrid selected item

bind="{sourceName.selectedItem.COLUMNAME}"

cfselect selected item

bind="{sourceName.selectedItem.data}"

Note: If you use the bind attribute, you cannot use the value attribute.

The following rules and techniques apply to the binding formats:

The following example shows how to use the values from the firstName and lastName fields to construct an e-mail address. The user can change or replace this value with a typed entry.

<cfformgroup type="horizontal" label="Your Name">
   <cfinput type="text" required="Yes" name="firstName" label="First"
      value="" width="100"/>
   <cfinput type="text" required="Yes" name="lastName" label="Last"
      value="" width="100"/>
</cfformgroup>
<cfinput type="text" name="email" label="email" 
   bind="{firstName.text}.{lastName.text}@mm.com">

ColdFusion 9 | ColdFusion 8 | ColdFusion MX 7 | ColdFusion MX 6.1 | ColdFusion MX | Forums | Developer Center | KnowledgeBase | Bug Reporting

Version 7

Comments


nimer said on Apr 7, 2005 at 12:25 AM :
Here is an example of binding a grid to a select list.

http://www.cfform.com/invoke.cfm?objectid=0204C17F-4E22-1671-564CF4F0B33C3D29&method=full

hth,
---nimer
jrunrandy said on Jul 26, 2005 at 11:48 AM :
I just saw some cool Flash form discussions at http://www.asfusion.com/blog/. Check it out if you get a minute.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/coldfusion/7/htmldocs/00001396.htm