1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24: | <form name="Test" action="">
Zahl: <input type="text" name="Eingabe" onblur="CheckZahl(this.value)">
</form>
<script type="text/javascript">
document.Test.Eingabe.focus();
function CheckZahl (Feld) {
if (Feld < 5) {
alert("Deine Zahl ist kleiner als 5!");
document.Test.Eingabe.focus();
return false;
}
if (Feld == 5) {
alert("Deine Zahl ist 5!");
document.Test.Eingabe.focus();
return false;
}
if (Feld > 5) {
alert("Deine Zahl ist größer als 5!");
document.Test.Eingabe.focus();
return false;
}
}
</script> |