how to stop regular form POST if jquery is working.
- <form id="mybasketform-add" method="post" action="<?= site_url('mybasket/add') ?>">
<input type="text" name="productID" id="productID">
<input type="text" name="quantity" id="quantity">
<input type="submit" value="Add to basket" id="add">
</form>
I'm trying to write an app that degrades if jquery is not supported. For example I've got the snippet above. Which works fine via regular post (when I have no jquery) but the problem is that when the jquery does an ajax add, the basket refreshes as expected which gives a nice UX but then the regular HTML form submit method takes place, how can I kill regular form submit?
Thanks in advance.