Александр345,
Вариант ... )))
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
<div id="contact_form">
<form method="post" action="mail.html" id="form" name="form" onsubmit="return check()">
<fieldset>
<h2>Обратная связь</h2>
<p class="text">
<label >Ваше имя:</label>
<input type="text" name="user_fname" value="" id="user_fname" />
</p>
<p class="text">
<label>Телефон:</label>
<input type="text" name="user_tel" value="" id="user_tel" />
</p>
<p class="text">
<label>Email:</label>
<input type="text" name="user_email" value="" id="user_email" />
</p>
<p class="text">
<label>Сообщение</label>
<textarea id="message"></textarea>
</p>
<p class="next">
<input type="submit" id="next" value="Отправить" />
<input type="reset" id="clear" value="Очистить" />
</p>
</fieldset>
</form>
</div>
<script type="text/javascript">
var rules = {
user_fname:[/\S+/],
user_tel:[/\S+/,/\d{6,11}/],
user_email:[/\S+/,/^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,3}/],
message:[/\S+/]
};
function check() {
var c = document.forms.form.elements,
a;
for (a in rules) for (var b = 0; b < rules[a].length; b++) if (!rules[a][b].test(c[a].value)) {
checkLable(c[a], 5);
return false
}
return true
};
function checkLable(b, a) {
b.style.backgroundColor = a % 2 ? "#f00" : "";
a-- && window.setTimeout(function (c, d) {
return function () {
checkLable(c, d)
}
}(b, a), 300)
};
</script>
</body>
</html>