OK; grazie ecco il test:
codice:
<script><!--
function validate(theform) {
var re = new RegExp("^UTE[A-Z]{2}-[0-9]{2}$", "");
if (!theform.new_code1.value.match(re))
{
alert("La password inserita non è corretta!\nLa nuova password è obbligatoria nella forma:\n\nUTEXX-YY\n\nin cui le variabili X sono lettere e le variabili Y sono numeri.");
theform.new_code1.focus();
theform.new_code1.select();
return false;
}
return true;
}
// -->
</script>
<form name="form1" method="post" action="edit.asp" onSubmit="return validate(this)">