How to stop onsubmit client script when click on the "Add to Cart" button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2023 12:18 AM
Hi All,
I have one onsubmit client script in the catalog item. the issue is the onsubmit client script is executing when click on the "Add to Cart" button.
I dont want to exicute the onsubmit client script when click on the "Add to Cart" button
Please help me to achieve this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2023 05:46 AM
Hi @ramesh_r,
if you want to run it to stop on some condition, then:
function onSubmit(){
if (condition){
return false;
}else{
return true;
}
}or if you want to completely stop your client script then:
function onSubmit(){
return false;
}
Let me know if you need any further help.
Thanks,
Rishabh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2023 12:04 AM
Hi
I want to stop the script only when click on the "Add to cart" button not for the request or submit button
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-08-2023 03:42 AM
Then you need to configure the Widget "Add to Cart" according to your requirement.
