Skip to main content
Inspiring
December 27, 2011
Answered

bind to onChange event?

  • December 27, 2011
  • 1 reply
  • 1479 views

i have a text field whose value can be changed programatically by a javascript function

i have a second field, bound to a cfc, passing the value of the first field to the cfc function

this works, but only onBlur or onKeyup, how can i make it work based on the onChange event of the first field, i.e. when my JavaScript function changes the value in the first field, pass that value to the bound field and get the result? something like onChange=ColdFusion.secondField.refresh

<cfform>

     <cfinput type="text" name="firstField" value="fromJavaScriptFunc">

      <cfinput type="text" name="secondField" bind="cfc:myCFC.myFunc({firstField@blur})" bindOnLoad="true">

</cfform>

thanks

This topic has been closed for replies.
Correct answer ion

i think i got it, though it's kind of undocumented. to my js function i add this call at the end:

ColdFusion.bindHandlerCache['mySecondFieldID'].call();

1 reply

ionAuthorCorrect answer
Inspiring
December 27, 2011

i think i got it, though it's kind of undocumented. to my js function i add this call at the end:

ColdFusion.bindHandlerCache['mySecondFieldID'].call();

BKBK
Community Expert
Community Expert
December 29, 2011

Please kindly mark it then as answered. Your experience will benefit others.