- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2021 03:08 AM
On a form in the service portal , I would like to block the "submit" button if the User selects the "Using Politemail" checkbox,
See screenshot
Your help will be much appreciated.
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2021 03:14 AM
Hi
Create a ONSubmit client script.
and check if selection is Using Politemail and use
return false
to prevent form submission.
Please mark Correct✅/helpful???? if applicable, thanks!!
Aman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2021 04:27 AM
Yes indeed this does not disable the button but the script prevents it from being submitted.
With your explanation following your link I offered him, so he preferred the script choice. Should I mark it as "helpful"?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2021 04:41 AM
Hi,
You can check the best response as correct based on the approach you took by referring the correct post.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2021 04:50 AM
I had shared with you the approach for restricting the form from submission, if you feel like that the approach was correct, you can mark it correct/helpful.
Thanks,
Aman
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-22-2023 02:15 PM
Hi I was hoping someone could help with an onSubmit() client script?
The script is to prevent a catalog item from being submit if a boolean variable is false.
I get the alert and the the item won't allow me to submit which is what it should do but if the variable is true then
it still behaves like it's false. The script is below. I've tried else, else if with a return true but that just cancels out the return false. Script below:
function onSubmit() {
//Type appropriate comment here, and begin script below
if (atgm_user == 'no') {
alert ('You cannot submit this request if you are not an ATGM user.');
return false;
}
Any help greatly appreciated 😊
}