- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2022 07:35 AM
Hi,
I have a probably simple question: Is it possible to disable the possibility to sent/submit forms, after choosing a specific form option in the form itself?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-05-2022 07:46 AM
Hello,
You can write a onsubmit script which will have the logic that if the chosen option is the one we just return false and the user is not able to submit the form.
The script will look something like below:-
function onSubmit(){
var mandatoryVar = g_form.getValue('fieldname');
if (mandatoryVar =="optionwewanttostopfor"){
alert("You cannot submit for this option");
return false; }
}
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0622896
Please mark my answer as correct based on Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-06-2022 02:34 AM
Thank you all! This works very well!