I have looked at quite a few posts on the issue and there seem to be several ways of doing this which is causing me confusion. The validation errors are popping up properly but the form is sent without entry in the form fields.
I have tried a few different solutions from other posts but I can't seem to get this to work out. I am sure it is something painfully apparent. Any help is greatly appreciated.
You can see what is happening Here
<script>
$(document).ready(function() {
$("#myform").validationEngine();
$("#myform").submit(function(){
var name = $("#name").val();
var email = $("#email").val();
var phone1 = $("#phone1").val();
var phone2 = $("#phone2").val();
var phone3 = $("#phone3").val();
var association_name = $("#association_name").val();
var association_city_state = $("#association_city_state").val();
var dataString = 'name='+ name + '&email=' + email + '&phone1=' + phone1 + '&phone2=' + phone2 + '&phone3=' + phone3 + '&association_name=' + association_name + '&association_city_state=' + association_city_state;
//to send the ajax request
$.ajax({
type: "POST",
url: "send/sendEmail.php",
data: dataString,
success: function() {
$(".form_main").slideUp("slow", function() {
$(".form_main").before('<div style="width: 300px; margin-left: auto; margin-right: auto;"><br/><br/><br/><h1>Success</h1><p>All good.</p></div>');
});
}
});
});
}); // ready
</script>