1<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.2/jquery.validate.min.js"></script>
1$(document).ready(function () {
2
3 $('#myform').validate({ // initialize the plugin
4 // rules & options
5 });
6
7 $('#button').click(function() {
8 if ($('#myform').valid()) {
9 alert('form is valid - not submitted');
10 } else {
11 alert('form is not valid');
12 }
13 });
14
15});
16
1function submitFunction(event){
2 event.preventDefault();
3}
4$("#form_id").submit(submitFunction);