CSS
37
Вклад в тег
<form id="contact-form" action="/email.php" metod="post">
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="/js/script.js"></script>
$(document).ready(function(){
$('#contact-form').submit(function(){
var subject = $(this).find("#subject :selected").text();
var name = $(this).find("#name").val();
var email = $(this).find("#email").val();
var message = $(this).find("#message").val();
if(!!name && !!email && !!message){
$.ajax({
type: "POST",
url: "/email.php",
data: {"subject": subject, "name": name,"email": email, "message": message},
cache: false,
success: function(){
/* действия при успешной отправке */
}
})
}
return false;
});
});
<? header("Content-type: text/html; charset=utf-8");
$text = "<b>subject</b>: ".$_POST['subject']."<br>";
$text .= "<b>name</b>: ".$_POST['name']."<br>" ;
$text .= "<b>email</b>: ".$_POST['email']."<br>";
$text .= "<b>message</b>: ".$_POST['message']."<br>";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=UTF-8\r\n";
mail('mail@mail.ru', 'Заголовок письма', $text, $headers);
?>
box-shadow
и outline
, добавьте outline:none;