I am using from https://github.com/posabsolute/jQuery-Validation-Engine
The validation worked, but AJAX didn’t work…
The problem is that it didn’t work to me many times, i tried to do it but it failed more than 30 times, i don’t know why, his AJAX submit php example isn’t useful to me…
There is my script to validate the form:
$("#formID").validationEngine({promptPosition : "centerRight", scroll: false, ajaxFormValidation: true});
There is my jQuery AJAX script that i want to integrate with Validation Engine:
$.ajax({
type: "POST",
url: "send.php",
data: sendData,
beforeSend: function () {
$("#ajax").show();
},
success: function () {
$('#listo').html("<p>Thank you!</p>")
.hide()
.fadeIn(1000, function () {
});
}
});
And there another my PHP script to send data form:
function send_email() {
$message = "\nNombre: " . $_POST['nombre'] .
"\nEmail: " . $_POST['email'] .
"\nMensaje: " . $_POST['message'] .
"\nTélefono: " . $_POST['tel'];
$message .= "\n\nBrowser Info: " . $_SERVER["HTTP_USER_AGENT"] .
"\nIP: " . $_SERVER["REMOTE_ADDR"] .
"\n\nDate: " . date("Y-m-d h:i:s");
$siteEmail = 'my@mail.com';
$emailTitle = 'Contact from your website';
$thankYouMessage = "succesful sent.";
if(! mail($siteEmail, $emailTitle, $message, 'From: ' . $_POST['nombre'] . ' <' . $_POST['email'] . '>'))
echo 'cannot send...';
}
Anyone can help me?
Could you try this out: