CFForm “Object Expected” Error

Helping a friend the other day, I discovered some quirkiness in using CFForm in a hosted environment. Now, if you have not gotten used to using CFForm in a hosted environment already… here a little bit of advice.
Copy the entire CFIDE/scripts directory into your site. Second, add the scriptSrc attribute to the CFForm tag that maps to the location of the CFIDE/scripts/cfform.js. By adding the mapping and these files into your site, the JavaScript that CFForm generates will be able to find the files it is looking for.
Now for the quirkiness. I noticed that even though I had copied all the files to the hosted site and I had added the scriptSrc attribute to my CFForm, not all of the generated JavaScript was mapped correctly.
The trick was to make sure to keep the exact same directory structure “CFIDE/scripts”.
In the end, my form looked like this:

<cfform method=”post” name=”myForm” format=”flash” scriptSrc=”CFIDE/scripts/cfform.js”>

And my directories looked like this:
index.cfm
CFIDE
– scripts
—-cfform.js
… and all the other files

Pass it on:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • StumbleUpon
  • Technorati
  • LinkedIn
  • MySpace
  • TwitThis
  • Google Bookmarks
  • Live-MSN
  • Pownce
This entry was posted in ColdFusion and tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>