I\'m trying to submit a form witch sends an email:
JS
var that = $(this);
$.ajax({
url: \'../wp-content/themes/bsj/php/validate.php\',
You did not provide your validate.php
code so I'm confused. You have to pass the data in JSON Format when when mail is success.
You can use json_encode(); PHP function for that.
Add json_encdoe
in validate.php in last
mail($to, $subject, $message, $headers);
echo json_encode(array('success'=>'true'));
JS Code
success: function(data){
if(data.success == true){
alert('success');
}
Hope it works