Don't allow a request to be submitted based on a certain value in a field.

chenelle
Kilo Expert

Does anyone have a script for not allowing a request to be submitted if they have a certain value in a selectbox or multiple choice selected?   So that the request don't go any where or "Order now" can't be submitted unless they change the value to the option in the selectbox or multiple choice that will allow them to submit the request or they cancel the request due to their answers not qualifying the request to be submitted.   For example there are two options in a drop down list:

<20

> 20

If the user selects <20, they can't submit the request and will need to cancel it.

If they select >20 then they can select the request.

Please advise if you can.

Thanks

Chenelle

1 ACCEPTED SOLUTION

parameswar
ServiceNow Employee
ServiceNow Employee

Hi,


You can write onSubmit client script on catalog item.


Go to item -> right click on catalog item header -> click on configure item


SS0.jpg


Then go to Catalog Client scripts tab


SS3.jpg


Then click on 'New' the write onSubmit client script as below


SS1.jpg


Now try to click on 'Order now'. Now you can see alert and form will not submit


SS2.jpg


View solution in original post

5 REPLIES 5

Nevermind.   I was able to fix the script.   Thank you!