How can stop submitting the catalog form when i select the NO

nikhitha24
Tera Guru

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

nikhitha24_0-1694110557258.png

 

1 ACCEPTED SOLUTION

Vishal Birajdar
Giga Sage

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;

}

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates

View solution in original post

7 REPLIES 7

Saurabh Gupta
Kilo Patron
Kilo Patron

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

Hi @Saurabh Gupta  

 

I have tried the script but it is not working.

Please help me on this.

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"

Vishal Birajdar
Giga Sage

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;

}

 

 

Vishal Birajdar
ServiceNow Developer

I know one thing, and that is that I know nothing.
- Socrates