Kód:
</html>
<head>
<script language="javascript" type="text/javascript">
function kontrola(form){
cislo="0123456789"
if (form.mesto.value=="")
{
alert('Treba vyplníť aj mesto')
form.mesto.focus()
return false
}
for(i=0;i<cislo.length;i++)
{
if(form.mesto.value.indexOf(cislo.charAt(i),0)>-1)
{
alert ('Chyba, mesto nesmie obsahovať číslo')
form.mesto.focus()
return false
}
}
return true
}
</script>
</head>
<body>
<form onSubmit="return kontrola(this)" action="#" method="get" name="formular">
<input name="mesto" type="text"/>
<input type="submit" name="go">
<form>
</body>
</html>