sana,
<!DOCTYPE HTML>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<script>
function check(form) {
var ok = true;
if (form.name.value.length < 1) {
alert("Введите имя!");
ok = false;
}
var email = form.email.value;
if (email.indexOf("@") == -1 || email.indexOf("@") < 1 || email.lastIndexOf(".") > email.length - 3 || email.lastIndexOf(".") < email.length - 5) {
alert("Неправильный e-postadress!");
ok = false;
}
return ok;
}
</script>
</head>
<body>
<form onSubmit="return check(this)" action="thanks.html">
<fieldset>
<legend>Введите данные</legend>
<p>Name: <input name="name" type="text" id="name"></p>
<p>E-mail: <input name="email" type="text" id="email"></p>
<input type="submit" value="Ok" id="submit">
</fieldset>
</form>
</body>
</html>