Kurcze - dalej walkuje ten sam problem i chcialem to jakos bardziej ergonomicznie zrobic :D i zrobilem tak:
<script>
```
function check(obj)
{
if (obj.mail.value.indexOf("@")>0 && obj.mail.value.lastIndexOf("@")==obj.mail.value.indexOf("@") && obj.mail.value.indexOf(".")>0 && obj.mail.value.indexOf(" ")==-1)
blad="0"; else blad="email";
if (obj.nr_konta.value.match(/^[0-9]{26}$/))
blad="0"; else blad="numer konta";
if (obj.kod.value.match(/^[0-9]{2}-[0-9]{3}$/))
blad="0"; else blad="kod pocztowy";
if (blad=="0") return true; else
{
alert(blad+": zle wpisany"); return false;
}
}
</script>
<form action="" method="post" onsubmit="return check(this)">
<input type="text" name="kod" maxlength="6" size="6" value="00-000">
<input type="text" name="nr_konta" maxlength="26" size="40" value="00000000000000000000000000">
<input type="text" name="mail" size="40" value="przykładowymail@">
<input type="submit" value="Wyślij">
</form>
```
i dziwne, ale jak wpisze zly KOD POCZTOWY to alert sie pojawia, a jak cos innego zle wpisze to juz sie nie pojawi.
Dlaczego - co jest jeszcze zle ?