Hi,
I'm using this form: http://youhack.me/2010/07/22/create-...-3-and-jquery/
and it validates fine, sends fine. However, when I press Send the email gets sent fine, but the form is then supposed to collapse and show a message, but I'm getting a: "you are not going into the success fonction and jsonValidateReturn return nothing"
This is my html:
and this is the php file:
Can anyone help me?
I'm using this form: http://youhack.me/2010/07/22/create-...-3-and-jquery/
and it validates fine, sends fine. However, when I press Send the email gets sent fine, but the form is then supposed to collapse and show a message, but I'm getting a: "you are not going into the success fonction and jsonValidateReturn return nothing"
This is my html:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Testing</title> <script src="js/jquery-1.5.2.min.js" type="text/javascript"></script> <script src="js/jquery-ui-1.8.12.custom.min.js" type="text/javascript"></script> <script src="js/SimpleNavBarScripts.js" language="JavaScript" type="text/javascript"></script> <script src="js/jquery.validationEngine-en.js" type="text/javascript"></script> <script src="js/jquery.validationEngine.js" type="text/javascript"></script> <!-- Links to the CSS for the Contact Forms --> <link rel="stylesheet" href="CSS/formstyle.css" type="text/css" media="all" /> <link rel="stylesheet" href="CSS/validationEngine.jquery.css" type="text/css" media="screen" title="no title" charset="utf-8" /> <link rel="stylesheet" href="CSS/template.css" type="text/css" media="screen" title="no title" charset="utf-8" /> <!-- Link to the main CSS used for Website. --> <link href="CSS/style.css" rel="stylesheet" type="text/css" /> <!-- Link to styles used for Navigation Bar --> <link href="CSS/SimpleNavBarStyles.css" rel="stylesheet" type="text/css" /> <script> $(document).ready(function() { // SUCCESS AJAX CALL, replace "success: false," by: success : function() { callSuccessFunction() }, $("#form1").validationEngine({ ajaxSubmit: true, ajaxSubmitFile: "ajaxSubmit.php", ajaxSubmitMessage: "Thank you, We will contact you soon !", success : function() { callSuccessFunction() }, failure : function() {} }) }); </script> </head> <body id="Home"> <div id="wrapper"> <div id="form-div"> <form class="form" id="form1"> <p class="name"> <input name="name" type="text" class="validate[required,custom[onlyLetter],length[0,100]] text-input" id="name" value="" /> <label for="name">Name</label> </p> <p class="email"> <input name="email" type="text" class="validate[required,custom[email]] text-input" id="email" value="" /> <label for="email">E-mail</label> </p> <p class="web"> <input type="text" name="web" id="web" /> <label for="web">Website</label> </p> <p class="text"> <textarea name="text" class="validate[required,length[6,300]] text-input" id="comment"></textarea> </p> <p class="submit"> <input type="submit" value="Send" /> </p> </form> </div> </div> </body> </html>
Code:
<?php //Code Updated on 18 Feb 2011 $name = $_POST['name']; // contain name of person $email = $_POST['email']; // Email address of sender $web = $_POST['web']; // Your website URL $body = $_POST['text']; // Your message $receiver = "[email protected]" ; // hardcorde your email address here - This is the email address that all your feedbacks will be sent to if (!empty($name) & !empty($email) && !empty($body)) { $body = "Name:{$name}\n\nWebsite :{$web}\n\nComments:{$body}"; $send = mail($receiver, 'Contact Form Submission', $body, "From: {$email}"); if ($send) { echo 'true'; //if everything is ok,always return true , else ajax submission won't work } } ?>