Dynamic script for checking unpopulated mandatory fields
- vegard.grutle
- Posts: 59
- Joined: Fri Mar 17, 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
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
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 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.
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
- vegard.grutle
- Posts: 59
- Joined: Fri Mar 17, 2017
Hi, Nikita!
Thanks for the clarification!
Much appriciated
Vegard
Thanks for the clarification!
Much appriciated
Vegard
-
- Information
-
Who is online
Users browsing this forum: No registered users and 5 guests