How to make atleast one to be selected on checkbox
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-18-2017 08:31 AM
Hello,
I have below requirement,
User has to select atleast one checkbox. all these checkboxes are in a container, i made the container mandatory it did not work.
some one has soluton for it??
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-14-2018 07:11 AM
The UI Policy no long works in London. I have several of them and they all stopped working when I upgraded.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2019 12:43 PM
please create an on submit client script and use below script ,, make sure to replace the checkbox with your checkbox names
function onSubmit() {
var checkboxes = ['checkbox1', 'checkbox2', 'checkbox3', 'checkbox4'];
var isSelected = false;
for (var i = 0; i < checkboxes.length; i++) {
if (g_form.getValue(checkboxes[i]) == 'true') {
isSelected = true;
break;
}
}
if (isSelected == false) {
g_form.addErrorMessage('At least one checkbox is required');
return false;
}
}
This is tested in My instance and working
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-07-2019 03:11 PM
The easiest way is to write a ui policy.
Inside that conditions section select all options you have as below.
incident is false and
change is false and
problem is false and
service_catalog is false and
hr is false and
knowledge is false and
approval is false and
assignment is false and
notification is false
After that, in the UI policy section set the Options as mandatory.