- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2016 03:44 AM
Hello All,
I need to clear the of the catalog form while clicking on add to cart.I wrote a script in on submit to clear the value.But it will not store in the table.Can you please suggest a solution for this?
Thanks
Solved! Go to Solution.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-14-2016 06:14 AM
So, it sounds like you want to clear all form fields onSubmit, when a user clicks the add to cart button? It also sounds like, since you're clearing form values onSubmit, before the RITM is added to the user's cart, all of the variable values are empty in the cart.
I think a simple way around this would be to redirect the user on the client-side with an onSubmit client script. You could redirect the user to the current catalog item - grab its unid dynamically - using window.location = x; This will add the item to the user's cart and reload the current form.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-17-2016 09:45 PM
Hello Adrew,
It was a perfect solution.Thank you very very much for your help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2016 12:50 AM
Hi Andrew, this is a fine workaround to prevent accidental duplicate requests!
I defined a Catalog Client Script, attached it to a particular item and it works.
However, this means I have to define an onSubmit script for each item in the catalog...Is there a way to enable this for all the items in the catalog at once?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-28-2016 05:54 AM
After a little bit of thinking I went this way: I created a new Variable Set and added the Script to that set. Then I can add the Variable Set to any item I need to without defining a catalog script for each item.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-11-2021 06:13 AM