Подскажите как настроить шаблон GP Responsive Landing Page

J2
На сайте с 19.05.2014
Offline
2
1748

Народ подскажите пожалуйста буду признателен как настроить форму отправки в GP Responsive Landing Page ВОТ сома форма

 <div class="left block">


<h3>Форма заказа или для связи</h3>

<form id="contact_form" onclick="return false;" method="post">
<label for="name">Имя</label><input name="name" id="name" type="text" placeholder="Имя">
<div class="clear"></div>
<label for="email">Телефон</label><input name="email" id="email" type="text" placeholder="Ваш Телефон">
<div class="clear"></div>
<label for="subject">Тема</label><input name="subject" id="subject" type="text" placeholder="Описание услуги">
<div class="clear"></div>
<label for="message">Адрес доставки</label><textarea name="message" id="message" placeholder="Ваш адрес доставки"></textarea>
<div class="clear"></div>
<input type="submit" value="Отправить или заказать">
</form>

</div>

также в шаблоне присутствует файл gplanding_ui.js в нем и прописан код проверки формы [JS]// Validation & Ajax Contact Form Settings

$('#contact_form input[type="submit"]').bind('click', function() {

$("#contact_form").validate({

rules: {

name: { required:true },

email: { required:false, email: false },

subject: { required:true },

message: {required: false}

},

messages: {

name: "Ваше имя",

email: { required: "Ваш контактный телефон", email: "Введите ваш контактный телефон" },

subject: "Вид услуг",

message: "Адрис"

},

errorElement: "span"

});

if($("#contact_form").valid()) {

$.ajax({

url: "send.php",

type: 'POST',

data: "name="+$('#name').val()+"&email="+$('#email').val()+"&subject="+$('#subject').val()+"&message="+$('#message').val(),

success: function(data) {

if(data == 'Complete') {

alert();

$('#contact_form').html("<div id='notification'><h2 style='color: rgb(33, 197, 26);'>Сообщение отправленно !</h2><p>"+data+"</p></div>")

.hide()

.fadeIn(1500, function() {

$('#contact_form').append("");

});

} else {

$('#contact_form').html("<div id='notification'><h2 style='color: #F00;'>Error !</h2><p>"+data+"</p></div>")

.hide()

.fadeIn(1500, function() {

$('#contact_form').append("");

});

}

},

error: function() {

$('#contact_form').html("<div id='error'><h2>Извините, произошла ошибка.</h2></div>").css('color', 'red');

}

});

return false;

}

});[/JS]

в нем есть четкое указание на передачу данных формы в файл send.php

Создаю send.php

вот код

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<?

if (isset($_POST['name'])) {$name = $_POST['name'];}
if (isset($_POST['email'])) {$email = $_POST['email'];}
if (isset($_POST['subject'])) {$subject = $_POST['subject'];}
if (isset($_POST['message'])) {$message = $_POST['message'];}


$name = stripslashes($name);

$subject = stripslashes($subject);



$name = htmlspecialchars($name);

$subject = htmlspecialchars($subject);


$email = stripslashes($email);

$message = stripslashes($message);


$email = htmlspecialchars($email);

$message = htmlspecialchars($message);






$address = "mail@mail.ru";

$message = "".$message."\nС уважением, ".$name."\nМой контактный Телефон: ".$email."\nТема: ".$subject."";

$verify = mail($address,$subject,$message,"Content-type:text/plain; Charset=utf-8\r\n");

?>

После нажатия кнопки отправить все приходит на почту но на странице постоянно выводиться сообщение Erorr подскажите как настроить.

Заранее огромное спасибо!!!

lutskboy
На сайте с 22.11.2013
Offline
192
#1

тогда уберите

else {

$('#contact_form').html("<div id='notification'><h2 style='color: #F00;'>Error !</h2><p>"+data+"</p></div>")

.hide()

.fadeIn(1500, function() {

$('#contact_form').append("");

}

Авторизуйтесь или зарегистрируйтесь, чтобы оставить комментарий