- 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 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 03:24 AM
Hi,
If this is a submit button that would be seen from a Record Producer or Catalog Item, you could disable the Submit button using an onSubmit Catalog Client Script in the Record Producer/Catalog Item.
Ensure that the onSubmit Catalog Client Script has a UI Type of "Both or only Service Portal", add in your conditional criteria for when you would want to disable the Submit button, and end that conditional criteria with "return false;" For instance:
function onSubmit() {
if (g_form.getValue('subcategory') == 'DisableSubmit') {
var message = '';
message = message + 'Submit is disabled for the specific subcategory' + '\n' + '\n';
alert(message);
return false;
}
}
Mark helpful/correct if that solves your issue.
Thanks,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-03-2021 03:25 AM
You cannot disable that Submit button unless you play around using HTML DOM.
That is not recommended.
Instead as per comment from Aman you can create onSubmit Catalog Client Script and stop the form submission.
If your business still requires to show/hide based on the change of the variable then refer below link where I have shared approach
Remove/disable/hide record producer Submit button.
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 03:54 AM
Did you accidentally marked other response as correct?
the response marked as correct doesn't mention about disabling the submit button.
Please mark appropriate response as correct so that it helps future members.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader