Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

bind to onChange event?

Participant ,
Dec 27, 2011 Dec 27, 2011

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

TOPICS
Advanced techniques
1.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Participant , Dec 27, 2011 Dec 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();

Translate
Participant ,
Dec 27, 2011 Dec 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();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 29, 2011 Dec 29, 2011
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources