- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2016 05:56 AM
I have a checkbox that says "check this box if you agree to the policy terms...". I made the variable "mandatory", but I can still click "order now" even when the checkbox is not checked. How can I make it so you can only "order now" after the checkbox has been clicked?
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
-
Team Development

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2016 06:58 AM
getValue() return the value as string. Try this
function onSubmit() {
//Type appropriate comment here, and begin script below SpaceIsThePlace
if (g_form.getValue('PolicyAgreement')=='false') {
g_form.showFieldMsg('PolicyAgreement', 'You must check the Policy Agreement checkbox', 'error');
return false;
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2016 01:36 PM
Dear Abhinay,
Dear Team,
I'm new in ServiceNow, can you share with me how to execute this script against the Checkbox field in the Request Form ??
Many thanks in advance
Best Regards

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2016 03:09 PM
HI Khaled,
See Abhinay's script marked as the correct answer for inspiration.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-29-2016 07:28 AM
Chuck is very generous. He loves helping poor people like me who only have 1/4 th of his total points.