- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 11:18 AM
Hi Team,
Please help me on the below requirement.
In the below screen when i select the FAQ sheet referred to "NO". i don't want to submit the form.
Please help me on this
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 06:45 PM - edited 09-07-2023 09:09 PM
Hi @nikhitha24
You should write onSubmit script as below :
// you can use backed end name of your variables
if(g_form.getValue('faq') == 'No'){
return false;
}
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 11:22 AM
Hi
There are two ways.
First you can use on submit client script and check if FAQ is no then return false, it will restrict form submission.
Second change the variable type to check box and make it mandatory.
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 11:35 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 09:02 PM - edited 09-07-2023 09:03 PM
Can you show us the script you used?
it should be as simple as
if("Variable name" == 'No'){
return false;
}
just need to make sure you use the correct variable value of "NO"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2023 06:45 PM - edited 09-07-2023 09:09 PM
Hi @nikhitha24
You should write onSubmit script as below :
// you can use backed end name of your variables
if(g_form.getValue('faq') == 'No'){
return false;
}
ServiceNow Developer
I know one thing, and that is that I know nothing.
- Socrates