JQuery Ajax form using boostrap validation
$(document).on('submit','#formid',function(){
$(this).formValidation({
framework: 'bootstrap',
fields: {
name: {
validators: {
notEmpty: {
message: 'The name is required'
}
}
},
email: {
validators: {
notEmpty: {
message: 'The email is required'
}
}
},
password: {
validators: {
notEmpty: {
message: 'The password is required'
}
}
},
}
})
.on('success.form.fv', function(e) {
e.preventDefault();
var Formdata=$(this).serialize();
$.ajax({
type: "POST",
url: '', //add page url here
data: Formdata, //send data from here,
success: function(data) {
alert(data);
}
});
});
});