If user don't select check box field then abort submit button in catalog item in servicenow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-09-2023 03:11 AM
If user don't select check box field then abort submit button with error message in catalog item in servicenow.
User should choose at least any one of these choices, if user do not select any of these checkbox then user should not able to submit request and error message should pop up.
Please help me with this query.
Thanks in advance!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 04:31 AM - edited 02-21-2023 04:32 AM
Are your selecting 'Selection Required' in both the checkboxes.
Only select the first checkbox.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 05:17 AM
Try using below UI Policy

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 07:10 AM
Hi @Sameeksha M ,
Use this Catalog client script(onSubmit) model.
function onSubmit() {
var c1 = g_form.getBooleanValue('check1'); //enter your field name of checkbox.
var c2 = g_form.getBooleanValue('check2');
if (c1 == false && c2 == false) { //if both the checkboxes are unselected
g_form.addErrorMessage("Kindly select atleast one check box");
return false; //simply use this line if you want to abort submit action.
}
}
If this solves your problem, please mark this as correct.
Khasim Pathan.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-21-2023 09:09 AM - edited 02-21-2023 09:10 AM
Business rule on before insert that aborts and flashes an error message if no checkboxes are selected? Or an onSubmit client script that checks and aborts submit?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-10-2023 03:12 AM
You can check these threads. Might be helpful:
https://servicenowguru.com/scripting/client-scripts-scripting/checkbox-variables-mandatory/
https://servicenowguru.com/system-definition/multiple-checkbox-variables-service-catalog-surveys/
Thanks,
Manirul