I need to find a way to refresh a page without including user form details – this is messing up my shopping cart system (number of items keeps going up on refresh). When I navigate away from the shop page then back the problem is gone. Only when I add an item to cart THEN click refresh the number of items start going up – so the form info is being stored whilst still on the shop page.
Is there a way with say jquery to clear/reset the form – like what happens when I navigate away and back to the page.
My site is http://www.flytraptestsite.com using Woocommerce (wordpress) – thanks.
I would guess the issue arises when the users browsers submits a form an extra time upon page reload. One possible solution might be not to use
window.location.reload()but instead just set the location manually, like so:window.location.href = some_url.You might also work around this issue by doing a HTTP redirect once a form has been successfully be submitted. That way, the page you are later reloading is the page redirected to, and not the page initially receiving the form submission (and thus potentially still holding on to the post data).