I'm using jquery validation plugin to validate contact form in my web but I don't know how to pass form fields after validation to a php file to send it to my peronal email.
This is my js code:
$('#contact-us').validate(
{
rules: {
contactName: {
minlength: 2,
required: true
},
email: {
required: true,
email: true
},
subject: {
minlength: 2,
required: true
},
comments: {
minlength: 2,
required: true
}
},
highlight: function(element) {
$(element).closest('.form-group').addClass('has-error');
},
unhighlight: function(element) {
$(element).closest('.form-group').removeClass('has-error');
},
errorElement: 'span',
errorClass: 'help-block',
errorPlacement: function(error, element) {
if(element.parent('.input-group').length) {
error.insertAfter(element.parent());
} else {
error.insertAfter(element);
}
}
});
}); // end document.ready
I think I have to use something like that solution but I can't get it work.
Anybody could help me? Thanks in advance