Dynamic script for checking unpopulated mandatory fields

Discussions about Forms Designer for SharePoint 2013 / 2016 and Office 365.
Locked
User avatar
vegard.grutle
Posts: 59
Joined: Fri Mar 17, 2017

09 Sep 2017

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

User avatar
Nikita Kurguzov
Posts: 889
Joined: Mon Jul 03, 2017

11 Sep 2017

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.
Cheers

User avatar
vegard.grutle
Posts: 59
Joined: Fri Mar 17, 2017

11 Sep 2017

Hi, Nikita!

Thanks for the clarification!

Much appriciated :)


Vegard

Locked
  • Information
  • Who is online

    Users browsing this forum: No registered users and 5 guests