Hide catalog form submit button and hide catalog form fields based one variable drop-down
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 07:58 AM
Hi Everyone,
I have requirement that I need to hide the form fields and submit button based on the catalogue variable drop-downchoice value.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-21-2023 08:03 AM
hiding dynamically the submit button will require DOM manipulation which I won't recommend.
Please use onSubmit catalog client script and stop the form submission
function onSubmit(){
var val = g_form.getValue('variableName');
if(val == 'choice 1 value' || val == 'choice 2 value'){
alert('You are not allowed to submit');
return false;
}
}
If my response helped please mark it correct and close the thread so that it benefits future readers.
Regards,
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader