<form onsubmit="sendForm(this); return false;" data-name="Заголовок">
<div class="form-title"></div>
<input type="text" name="name" placeholder="Имя">
<input type="text" name="email" placeholder="E-mail">
<input type="submit" value="Отправить">
</form>
function sendForm(form) {
var formTitle = $(form).attr("data-name");
$(form).parent('.form-title').html(formTitle);
}
function sendReview(form) {
jQuery.ajax({
url: "/wp-content/themes/gorbunov_v2/mail/mail.php",
data:$('#review-form-sender').serialize(),
type: "POST",
success:function(data){
$("#mail-status").html(data);
$(".mail-status").show(300);
},
error:function (){
$('#mail-msg', form).html(data);
$('#mail-msg', form).css('red');
}
});
}