Control Rules Not Firing When Custom JS Is Added

  • 13 October 2016
  • 3 replies
  • 4 views

Userlevel 6
Badge +12

I stumbled upon a strange issue and I can only guess at the reasoning, so I hope someone has a bit more insight on to the specifics of why.

Scenario:

  • I have a form with a custom JS function in which I am updating a "hidden" (tucked behind a label so users do not edit it) based upon a calculated field. These fields are date only. I am triggering my JS function on the Save button. Here is the JS function:

193161_pastedImage_1.png

  • I have a validation rule attached to a different control on the form. It is a simple (IsNullOrEmpty({Self})) rule.

I cannot get the validation rule to fire properly while I have the JS function in my form, but if I remove it, the rule fires as expected. I have tried doing a simple window.alert("Hello World!") function, and the rules fire just fine, so what am I missing?

Is this because I am attempting to update a field just before submit? Is this interfering with the normal validations?

I removed the field update and baked it into my workflow since it is a simple column update, but this has been nagging at me most of the week and I cannot get a good answer on why it is happening.

Thanks in advance!


3 replies

Badge +9

Any errors in developer console? Is 'disp' method available?

Badge +5

Yeah this can happen if you have some javascript error on page load. Hit F12 and double check.

Perhaps attach your form so I can help you take a look?

Userlevel 6
Badge +12

Should have looked here first!

193491_pastedImage_1.png

I removed that line since I am doing this just before submit and there is no need to display the data to the user. We just need to update the list field.


Thanks!

Reply