Answers for "jquey validate and submit form using jquery ajax"

3

submit ajax form validation jquery

$('#form').validate({

    ... your validation rules come here,

    submitHandler: function(form) {
        $.ajax({
            url: form.action,
            type: form.method,
            data: $(form).serialize(),
            success: function(response) {
                $('#answers').html(response);
            }            
        });
    }
});
Posted by: Guest on May-12-2020
0

jquey validate and submit form using jquery ajax

$("#form_id").validate({
rules:{
	name:"required",
	email:{email: true,required: true},
	mobile:{required : true,minlength:10},

},

messages: {
	name:"Please fill name",
	email:{email:"Enter Valid Email!",
		required:"Enter Email!"
		},
	mobile:{minlength:"Please enter Valid Mobile No.",
		required:"Please enter Mobile No."
		},
},

submitHandler: function(form){
$.ajax({
	url: form.action,
	type: form.method,
	data: $(form).serialize(),
	success: function(response) {
		$('#answers').html(response);
	}            
      });		
}
});
Posted by: Guest on March-05-2021

Code answers related to "jquey validate and submit form using jquery ajax"

Code answers related to "Javascript"

Browse Popular Code Answers by Language