<?php
$name = trim($_POST['name']);
$email = trim($_POST['email']);
$messege = trim($_POST['messege']);
$to = "почта";
$from = "test@rush.ru";
$subject = "Сообщение с сайта";
$headers = "From: $from\r\nReply-To: $from\r\nContent-type: text/plain; charset=utf-8\r\n";
mail($to, $subject, $messege, $headers);
?>
<span class="glyphicon glyphicon-warning-sign form-control-feedback"></span>
var input = $('input').mouseleave(function(){
if(input.val().length !== 0){
$(this).parent(".input-group").append('<span class="glyphicon glyphicon-ok form-control-feedback"></span>');
};
if(input.val().length == 0){
$('<span class="glyphicon glyphicon-ok form-control-feedback"></span>').remove();
$(".input-group").append('<span class="glyphicon glyphicon-remove form-control-feedback"></span>');
};
});
Вот это часть работает:
<code> if(input.val().length !== 0){
$(this).parent(".input-group").append('<span class="glyphicon glyphicon-ok form-control-feedback"></span>');
};</code>
а вот это часть не работает:
if(input.val().length == 0){
$('<span class="glyphicon glyphicon-ok form-control-feedback"></span>').remove();
$(".input-group").append('<span class="glyphicon glyphicon-remove form-control-feedback"></span>');
};