jQuery submit form without reloading page
I'm not very familiar with jQuery. I'm trying to make a form that is submitted in the background without reloading page. I have a hidden div which shows and hides on click, inside the div there's a form. I have two problems: 1) When the form validation fails, the form is still submitted. I tried to put validation and submission codes in condition if(validation == valid) { $.ajax.... } but it does not work properly. 2) After the form is submitted the div automatically hides, so successful message cannot be seen. Here's the code: $().ready(function() { // Validate the form when it is submitted,