giusto, ho fato alcune migliorie, sulla base di Bruno:
codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="it">
<head>
<title></title>
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript">
<!--
function Iban(cod){
if(cod.value.length<27){alert("Iban troppo corto");cod.value='';}
else if(cod.value.length>27){alert("Iban troppo lungo");cod.value='';}
else if(!/^[a-zA-Z]{2}\d{2}[a-zA-Z]{1}\d{10}[a-zA-Z0-9]{12}$/.test(cod.value)){alert('iban formalmente errato');cod.value='';}
}
//-->
</script>
</head>
<body >
<div align="center">
<form name="myform" action="">
<input name="iban" id="iban" type="text" onblur="Iban(this)" size="50" />
</form>
</div>