AnsweredAssumed Answered

How to trigger Javascript from Yes/No checkbox

Question asked by ornicus on Apr 4, 2017
Latest reply on Apr 4, 2017 by ornicus

Hello,

 

I have a form with a Yes/No field and a choice field with dropdown.

I want to change the value of my dropdown depending if the Yes/No field is checked or not (I do so, so that user can still force the choice manually afterward if needed).

 

I can not succeed to trigger my custom javascript depending if the box is checked or not.

 

The client ID is defined for both fields.

My method used to work for other type of fields, but not for the yes/no it seems.

 

for exemple, if my custom js is:

function test(){alert('hello world');}

if I add test() into the custom validation of the field:

  • yes/no--> js is not triggered if I check or uncheck the box
  • choice field with dropdown-->js is triggered whenever I choose one of the dropdown element

 

Any ideas?

Outcomes