You probably know that when you use flash forms in Coldfusion MX 7 you are not allowed to use the word "new" in any of the actionscript event handlers you choose to create. For example, you could not write "myvar = new Object();" in your actionscript. If you tried, you would get a message saying that it was an "illegal use of actionscript". What you may not know is that you cannot even use the "new" keyword as a string!
In this example from Tyler Clendenin on CF-Talk he is trying to rebuild an array drop-down based on selections in a different nearby drop down list. He's looping through the data and adding it to the drop down.
Believe it or not, this code throws the "illegal use of Actionscript" error - even though the word "new" is clearly not being used as a code keyword. It gets better. According to Ryan Guill, even if you try and use it in a label it will error out - as in the following.
How you did that is not recommended (will cause recompiling of the form every time that value changes), however, I see why you did it that way. Now, to avoid that... the cleanest way is to use an extra hidden field to store the original value and then use it in the bind: bind="{sameAddress.selected ? subscriberEdit.bCity : myFormName.MyHiddenField}"
Otherwise use a hack (not recommended)
bind="{sameAddress.selected ? subscriberEdit.bCity : remoteObject_myFormName.getData.result['sCity']}" value="#qExample.cityName#"
Hope that helps,
Laura
Justin Cook wrote:
Laura,
I think it has to do with this particular code:
<cfinput name="sCity" type="text" width="150" maxlength="50" required="yes" validateat="onsubmit" message="Please provide the subscriber's city." label="City: " bind="{sameAddress.selected ? subscriberEdit.bCity : '#qSubscriber.sCity#'}"/>
I have the bind because there's the option of having the same address on business and shipping. How can I change this and it still work?
Justin