
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2021 05:44 PM
I have a group of checkboxes i want to set as mandatory from the Form Design. I know from catalog item, adding a label and setting as mandatory will do the trick. Can I please get suggestions on how I can do this from a Form Design view?
Thank you
Solved! Go to Solution.
- Labels:
-
Instance Configuration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2021 12:21 PM
I've only ever used this as a Catalog Client Script rather than a Client Script; but that shouldn't really make a huge difference, other than where/when it runs.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2021 05:55 PM
Hi,
On the form we cannot make group of checkboxes mandatory. However, you can use on submit client script or Insert/update business rule to allow/restrict submission if all of the checkboxes are not checked and display the error message to the users.
Hope that helps!
Regards,
Muhammad
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2021 06:31 PM
Thanks for the suggestion.
How can I make the client script say - when at least 1 check box is selected, allow submission?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-11-2021 03:47 AM
You will need to create a flag that will turn to true if any of the checkboxes is checked, that can find by using if conditions
something like this.
var flag = false;
if(checkbox1 == true)
flag = true;
else if(checkbox2 == true)
flag = true;
else if(checkox3 == true)
flag = true;
.
.
.
if(flag == false)
return false; //abort the submission as no checkbox is checked.
Please note, you can make the above code is just a sample. you can make that code more efficient and dynamic using the loops, arrays, or may be creating the system property and storing the checkboxes field names in there.
Muhammad

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-10-2021 06:07 PM
You can have a UI policy that sets them as mandatory