I build a page to modify a product. So I have a form with product data.
I added a button that, when we click on it, does some stuff in Ajax. At the end of the treatment, I just want to refresh my page (because I display a flash message of confirmation). In short, I just want to show my page (not submit it).
This treatment is completely something else than modifying product data.
I tried these different solution :
window.location.href = window.location.href
// or
window.location.reload(true);
// or
window.location = window.location.href;
// or
window.location.href = window.location.protocol +'//'+ window.location.host + window.location.pathname;
// or
location.reload();
Everytime, it submits my form and my product is updated !!
But I don't send any post data. I just want to do the same action than if I push F5 on my keyboard = show my form (not submit it).
Any idea ?
Don't forget to add <button type="button" ...
or it's a submit button by default.
Rookie mistake...
Another solution is to display the confirmation message with jQuery without refreshing the page.
Don't forget to add <button type="button"
... or it's a submit button by default.
Rookie mistake...
Another solution is to display the confirmation message with jQuery without refreshing the page.