TechnicallyChris.com

Technical and Personal Ramblings of a Bostonian
  • Home
  • About Chris
  • Donate
  • Contact Chris
Home > ColdFusion > Flash Forms – Using BIND for more than just your {AS}

Flash Forms – Using BIND for more than just your {AS}

July 19th, 2006
Goto comments Leave a comment

I learned something great today and I thought I’d share it with everyone. It turns out that you can use “BIND=” for more than just including the bind when you’re binding a CFFORM flash item to something else. In the past, I’ve used BIND like so:

1
<cfitem type="text" bind="{grContacts.dataProvider[grContacts.selectedIndex]['FULL_NAME']}" />

Which would bind this item to the currently selected FULL_NAME in a CFGRID tag. However, what if I wanted to greet this person in the text area? I used to do this:

1
2
<cfformitem type="text">Good Morning </cfformitem
<cfformitem type="text" bind="{grContacts.dataProvider[grContacts.selectedIndex]['FULL_NAME']}" />

This, however, would cause me to have to do some pretty nutty formatting and sizing so that they sat next to each other. Most of the time, I wouldn’t bother. But I’ve learned different now, and I can now code the pages as follows:

1
<cfformitem type="text" bind="Good Morning {grContacts.dataProvider[grContacts.selectedIndex]['FULL_NAME']}" />

Notice you can put non AS {stuff} into your BIND? Pretty sweet. You can also do formatting in there (if you’re using TYPE=”HTML”). If it’s anything more than a few words, you’ll probably want to set the variable ahead of time, and then bind to that variable such as this:

1
2
3
4
<cfsavecontent variable="bindGreeting">
  Good Morning, {grContacts.dataProvider[grAllocations.selectedIndex]['FULL_NAME']}, it's great that you've come back!
</cfsavecontent>
<cfformitem type="text" bind="#bindGreeting#" />

For what it’s worth, I can’t think of any situation where I’d greet a name based on a binding to a CFGRID, but there are obviously plenty of good real life uses for this.

If you enjoyed this article or it helped you in any way, I’d appreciate it if you’d post a comment below to let me know. All code examples are for demonstration only and should be used at your own risk. I cannot accept liability for unexpected results.

Chris ColdFusion ColdFusion, Flash

Comments (0) Trackbacks (0) Leave a comment Trackback
  1. No comments yet.
  1. No trackbacks yet.
Subscribe to comments feed
Little Known CF Functions: ValueList Using ColdFusion ServiceFactory to List All Scheduled Tasks
RSS feed
  • Google
  • Youdao
  • Xian Guo
  • Zhua Xia
  • My Yahoo!
  • newsgator
  • Bloglines
  • iNezha

Sponsored By

RoboForm: Learn more...Read my review of RoboForm here.

Recent Posts

  • Just Bought the Google Nexus One
  • Seven Things I’ve Liked About Windows 7 in Seven Day
  • What’s Happened to Customer Service (Part 2)?
  • What’s Happened to Customer Service (Part 1)?
  • Capturing S.M.A.R.T. Hard Disk Data from WMI with AutoIt
  • Adjusting DCOM Settings via Script
  • How to Manually Call the Google Cache
  • RoboForm & RoboForm2Go Product Review
  • Updated PingCell Function for Excel
  • Creating Hyperlinks in Word and Excel Longer than 256 Characters

Categories

  • ColdFusion
  • Firefox
  • Google Nexus One
  • IIS
  • McAfee EE / SafeBoot
  • Microsoft Windows
  • Oracle
  • Random Code
  • Random Technology
  • Sports and Recreation
  • Subversion
  • The Untechnological

Archives

  • January 2010
  • October 2009
  • September 2009
  • August 2009
  • July 2009
  • June 2009
  • May 2009
  • April 2009
  • March 2009
  • October 2007
  • September 2007
  • August 2007
  • January 2007
  • November 2006
  • October 2006
  • September 2006
  • August 2006
  • July 2006
  • June 2006
  • May 2006

Meta

  • Register
  • Log in
PageRank
Top WordPress
Copyright © 2006-2010 TechnicallyChris.com
Theme by mg12. Valid XHTML 1.1 and CSS 3.