I have a page (call it Page1) with a button in it. This button when clicked loads a new php page into a div on Page1. The newly loaded page (Page2) contains another form that when submitted is forcing the original page (Page1) to refresh.
I believe I can stop the refresh with something along the lines of:
$("#ping").submit(function(e) {
e.preventDefault();
});
However I cant seem to get it to work correctly. If I load the Page2 on its own and submit, the page isn't refreshed. But if it is loaded into the div on Page1 and submitted it refreshes Page1.