Levy
Forms Fledgling

Why a custom validation function runs twice?

I have added a custom validation function to a field (Choice)  on a task form.

The js function is within a referenced file.

The signature is 

validateRuleClass = function(source, arguments) { ... }

The code in that function is working fine, but I noticed that the function is called twice.

How to avoid the second call?

What can cause such issue?

This is about SharePoint 2013 On-Premises

0 Kudos
Reply
1 Reply
MegaJerk
Automation Master
Automation Master

Re: Why a custom validation function runs twice?

It could be any number of things. Some controls have update phases that aren't straight forward, especially when changed, so it could just be the control going to some in-between state before finally updating to a value that had to be grabbed through some non synchronous method. 

Also validations rules can be evaluated both at the time of *certain* control events on form, but also always when you submit a form. 

 

Is the second evaluation causing an issue? 

0 Kudos
Reply