You are viewing limited content. For full access, please sign in.

Question

Question

Formula not triggered by field populated with javascript

asked on February 7, 2018

I have an Overall Pass/Fail field with a really long IF formula.  Basically, if any one of about 12 other fields are FAIL or UNACCEPTABLE the Overal Pass/Fail field is set to FAIL.  I also have a HiddenInsResistPassFail field that is set to F by javascript.  The javascript is doing some number comparisons and other 'fancy' stuff in the background on other fields.  If those fields are not populated to data within the range defined the background is changed to red and the HiddenInsResistPassFail field is set to F.  The problem is that it appears that the formula in my Overall Pass/Fail field is NOT triggered to run if the javascript changes the HiddenInsResistPassFail field.  The formula is only triggered if on those 12 other fields are manually changed.  Is that the way it is expected to behave?  Is there a way to force the formula to be triggered?  Or something else I should be doing?

 

Thanks,

Alon

0 0

Answer

SELECTED ANSWER
replied on February 7, 2018

In your custom javascript, you need to trigger a change event after you set your field.

$('.field1 input').change();

or at the same time as setting it.

$('field1 input').val(newValue).change();

 

0 0
replied on February 7, 2018

Thanks John! That fixed it!

0 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.