- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2021 04:14 AM
How to disable the submit button in the catalog form if the variable choice option is selected as Disagree
Solved! Go to Solution.
- Labels:
-
Service Catalog
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2021 04:56 AM
Why not use onSubmit catalog client script and if the variable is Disagree stop form submission
function onSubmit(){
if(g_form.getValue('variable') == 'Disagree'){
alert('Not allowed');
return false;
}
}
you need to write onChange catalog client script on that variable
Show/hide the button using DOM
Note: DOM is not recommended approach
check this link for help
Show/Hide Submit button on Catalog Item
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
‎07-27-2021 04:16 AM
Hi,
You can't disable submit button. Instead you can create client script and show error message and cancel form submission if choice value is disagree.
Thank you,
Palani
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2021 04:27 AM
Hi Palani,
Thank you so much for your prompt reply. Could you please share the catalog client script for this so that it would be useful for us to complete the requirement.
Regards
Sanjay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2021 04:16 AM
Why to disable the Submit button?
You don't need to submit the form when user selects Disagree as a option?
Thanks,
Murthy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-27-2021 04:29 AM
Hi Murthy,
Yes, that's correct. request to share catalog client script for this.
Thanks
Sanjay