1$('#form').validate({
2
3 ... your validation rules come here,
4
5 submitHandler: function(form) {
6 $.ajax({
7 url: form.action,
8 type: form.method,
9 data: $(form).serialize(),
10 success: function(response) {
11 $('#answers').html(response);
12 }
13 });
14 }
15});
1$("#form_id").validate({
2rules:{
3 name:"required",
4 email:{email: true,required: true},
5 mobile:{required : true,minlength:10},
6
7},
8
9messages: {
10 name:"Please fill name",
11 email:{email:"Enter Valid Email!",
12 required:"Enter Email!"
13 },
14 mobile:{minlength:"Please enter Valid Mobile No.",
15 required:"Please enter Mobile No."
16 },
17},
18
19submitHandler: function(form){
20$.ajax({
21 url: form.action,
22 type: form.method,
23 data: $(form).serialize(),
24 success: function(response) {
25 $('#answers').html(response);
26 }
27 });
28}
29});