Page 1 of 1

Dynamic script for checking unpopulated mandatory fields

Posted: 09 Sep 2017
by vegard.grutle
Hi!

I would like to generate an alert message if a mandatory field is not populated once a user click save (Alert: "One or more fields needs to be populated").

I have looked into some other posts which indicates that you need to identify all fields to checkif mandatory or not.

What i would hope for is a dynamic script that without naming all the fields (i have a lot of them).

In anticipation, thanks!


Vegard

Re: Dynamic script for checking unpopulated mandatory fields

Posted: 11 Sep 2017
by Nikita Kurguzov
Hello, Vegard!
Unfortunately, no, that is not possible. If you are using same fields, you might use an array with the names of the fields and then loop through this array and check the field values, but that could be problematic as different fields often rely on different code to get their value.

Still, if you have 20 text fields, for example, you might want to try this method for them. Refer to our documentation for get methods - https://spform.com/javascript-framework ... eld-values

But in the end, you still need to manually check all the fields, one way or another.

Re: Dynamic script for checking unpopulated mandatory fields

Posted: 11 Sep 2017
by vegard.grutle
Hi, Nikita!

Thanks for the clarification!

Much appriciated :)


Vegard