- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2016 11:30 AM
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
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2016 09:57 PM
Hi,
You can write onSubmit client script on catalog item.
Go to item -> right click on catalog item header -> click on configure item
Then go to Catalog Client scripts tab
Then click on 'New' the write onSubmit client script as below
Now try to click on 'Order now'. Now you can see alert and form will not submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2016 09:57 PM
Hi,
You can write onSubmit client script on catalog item.
Go to item -> right click on catalog item header -> click on configure item
Then go to Catalog Client scripts tab
Then click on 'New' the write onSubmit client script as below
Now try to click on 'Order now'. Now you can see alert and form will not submit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2016 12:48 PM
Thank you Parmeswar! That worked for the alert on submit, however, after I clicked ok on the alert message, and then clicked "Order Now" I was still able to submit my ticket. I want it to just spin and never submit if it is less than 20. I know that can be done as i did it in the past with another developer but i totally forgot the script for it. Please help if you can.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-22-2016 10:29 PM
Please make sure that you return false after alert.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2016 10:32 AM
Thank you for your help. The script you gave me does work. However, the other option which is more than 20 wont submit either.
So I have the multiple choice as below and the less or more option does as it should and doesn't move forward with the request if I click order now. However when I select 20 or more, it does not move forward either. The script is only for Less than 20 <20. So i don't know why it doesn't work. See the script below too. Do you know why it isn't working correctly when I select 20 or more? Thanks!