I understand that this has been asked several times, but I wonder if you can help me in the situation.
Reference Information. I tried to create a form that submits using Ajax (jQuery Form Submit). Which I received in order to work fine, and then I wanted to receive confirmation in the form. Which I was able to get to work with the jQuery form validation plugin. But I can’t get them to work together.
Basically, it simply represents a form of weather or is not "valid."
I hope this is something simple. Can you see the problem?
$('#addCompany').submit(function() {
$('#addCompany').ajaxSubmit({
target: '.response',
beforeSubmit: validateForm,
success: function () {
$('.response').fadeIn('slow');
}
});
});
});
function validateForm() {
$("#addCompany").validate({
rules: {
company: "required",
contactEmail: "required"
},
messages: {
company: "Please enter the clients company",
contactEmail: "Please enter a valid email address",
}
});
}
source
share