MrCypukat,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
</head>
<body><form name="authForm" onsubmit="return false">
<table border="0">
<tr>
<td align="right">Введите имя: </td>
<td><input type="text" name="vname" id="vname"></td>
</tr>
<tr>
<td align="right">Введите фамилию: </td>
<td><input type="text" name="vsurname" id="vsurname"></td>
</tr>
<tr>
<td align="right">Введите возраст: </td>
<td><input type="text" name="vage" id="vage"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" value="talkToMe" onClick="get()"></td>
</tr></table>
</form>
<script type="text/javascript">function message(name,surname,age){
MyReg = new RegExp("\\D+");
if (MyReg.test(age)) {
a=true;
}
else{
a=false;
}
var var1=name- ((name/1 | 0)*1);
var var2=surname - ((surname/1 | 0)*1);
if ((a==false) && (var1 !=0) && (var2 != 0) && ((age!="")&&(surname!="")&&(name!=""))){
if ((age==1)||(age==21)||(age==31)||(age==41)||(age==51)||(age==61)||(age==71)||(age==81)||(age==91)||(age==101)){
alert("Вы-"+name+" "+surname+ " и вам "+' ' +age+"год");
}
else if ((age>=2 && age<=4)||(age>=22 && age<=24)||(age>=32 && age<=34)||(age>=42 && age<=44)||(age>=52 && age<=54)||(age>=62 && age<=64)||(age>=72 && age<=74)||(age>=82 && age<=84)||(age>=92 && age<=94)){
alert("Вы-"+name+" "+surname+ " и вам "+' ' +age+"года");
}
else if ((age>=5 && age<=20)||(age>=25 && age<=30)||(age>=35 && age<=40)||(age>=34 && age<=50)||(age>=55 && age<=60)||(age>=65 && age<=70)||(age>=75 && age<=80)||(age>=85 && age<=90)||(age>=95 && age<=100)){
alert("Вы-"+name+" "+surname+ " и вам "+' ' +age+"лет");
}
}
if (a==true) {
alert("ERROR!!!");
}
}
function get(){
var name = document.getElementById("vname").value;
var surname = document.getElementById("vsurname").value;
var age = document.getElementById("vage").value;
message(name,surname,age);
}
</script>
</body>
</html>