check box should be checked before submitting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 02:33 AM
In the case form, security check box should be mandatory before submitting.But i am able to submit without clicking on checkbox .Its not highlighting the mandatory field.
I have given UI policy still not working.It should be mandatory and visible only when Channel field is selected as Phone.
- Labels:
-
Customer Service Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 02:39 AM
Hi,
Use OnSubmit() client script.
g_form.setMandatory('security_check_complete',true);
Thanks,
Kunal

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 02:42 AM
Hey Sweta
Because might be there is initial value is already assign i.e. false or uncheck.
Because the initial value is already assign to that filed. & you are validating that field should be filled which is true. That is the reason it got submitted.
So you can remove the initial value which, I tried to do I can't. however if you can do that I am sure your query will be resolve.
Another way either you can change it to drop-down list with the option of true & false or you can just validate that this filed should be clicked.
If the above suggestion helped you then please mark my answer Correct and Helpful.
Thanks and Regards:
Siddhnath Pandey
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 02:46 AM
Hi Shweta,
If you want Security Check Complete as checked why don't you make it's default value as "true" because making a checkbox field mandatory is of no use as it retains true and false value. In your case form will be submitted if you check or uncheck the box. Why don't you try to show alert to user to make the field checked while submitting the form using onSubmit Client Script or use before BR, If he tries to submit the form without making the field checked, show error message and use abort action to abort the form from submission.
If I suggestions make sense then mark as Correct and Helpful.
If any assistance is needed please let me know.
Regards,
SUbhojit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2020 03:59 AM
Hi Shweta,
that's because it is boolean field and even with a value of False it considers it as a valid value and hence you don't see the red mark
you can use onSubmit client script for this; remove UI policy
function onSubmit(){
if(g_form.getValue('channel') == 'phone'){
if(g_form.getValue('u_security_check_complete').toString() != 'true'){
g_form.addErrorMessage('Please mark the checkbox of security check complete');
return false;
}
}
}
Mark ✅ Correct if this solves your issue and also mark 👍 Helpful if you find my response worthy based on the impact.
Thanks
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader