Copy link to clipboard
Copied
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
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();
Copy link to clipboard
Copied
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();
Copy link to clipboard
Copied
Please kindly mark it then as answered. Your experience will benefit others.