Skip to main content

Hi,

 

I'm setting a value in a field using JavaScript, and I have a rule that show some fields based on this value but the rule is not working.

Is there any way to enable the rule? It is like is not being refreshed. However it works if I type something in the field (I cannot do this because it will be hidden)

 

Regards,

Hi,

you have to say to your control to refresh :

Ex :

var control = NWF$("#" + varControlID);

control.val(value);

NWF.FormFiller.Functions.ProcessOnChange(control);

This works fine for input text

For choice field, i use :

control.trigger('change');

instead of ProcessOnChange

Regards,


Hello Alicia Garcia​ – What you're experiencing is likely caused by the fact that manipulating a field through JavaScript doesn't trigger a change event in the same way that manual manipulation does.

Have you tried giving focus to and away from that field after it's been changed to force the rule to re-execute?


Thanks, you saved me a lot of time.

Regards,

Alicia


Thanks, previous answer worked for me.


Reply