housewm,
... вариант валидации формы на jquery ...
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script>
$(function () {
$('#foo').submit(function () {
var $input = $('input:text', this),
error = '';
$input.each(function (indx, element) {
$val = element.value;
$(element).css({
background: $val ? '' : (error += 'незаполнено ' + element.placeholder + '\n', '#FF9494')
})
});
if (error) {
alert(error);
return false
}
return true;
});
})
</script>
</head>
<body>
<form id="foo" action="\">
<input type="hidden" name="discount" value="35%">
<input type="text" name="name" placeholder="Имя">
<input type="text" name="email" placeholder="Email">
<input type="text" name="phone" placeholder="Телефон">
<input type="submit" value="Заказать звонок">
</form>
</body>
</html>