NON MI FUNZIONA ..........l'unico controlla che mi fa è il mio (la lunghezza della stringa)codice:........ </head> <script> function CheckCodiceFiscale(cfins){ var cf = cfins.toUpperCase(); var cfReg = /^[A-Z]{6}\d{2}[A-Z]\d{2}[A-Z]\d{3}[A-Z]$/; if (!cfReg.test(cf)) return false; var set1 = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var set2 = "ABCDEFGHIJABCDEFGHIJKLMNOPQRSTUVWXYZ"; var setpari = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; var setdisp = "BAKPLCQDREVOSFTGUHMINJWZYX"; var s = 0; for( i = 1; i <= 13; i += 2 ) s += setpari.indexOf( set2.charAt( set1.indexOf( cf.charAt(i) ))); for( i = 0; i <= 14; i += 2 ) s += setdisp.indexOf( set2.charAt( set1.indexOf( cf.charAt(i) ))); if ( s%26 != cf.charCodeAt(15)-'A'.charCodeAt(0) ) return false; return true; } </script> <SCRIPT language="JavaScript"> function CheckForm () { //Initialise variables var errorMsg = ""; if (document.frmEnquiry.cognome.value == ""){ errorMsg += "\nInserire Cognome"; } if (document.frmEnquiry.nome.value == ""){ errorMsg += "\nInserire Nome"; } if ((document.frmEnquiry.cod_fisc.value.length < 16)|| (document.frmEnquiry.cognome.value == "")){ errorMsg += "\nCodice Fiscale non valido"; } if (!frmEnquiry.acc[0].checked){ errorMsg += "\nAutorizzazione al trattamento dei dati (L. 675/96)"; } if (!frmEnquiry.acc_01[0].checked){ errorMsg += "\nArt. 26 Legge 15/68,"; } if (errorMsg != ""){ msg = "I seguenti campi devono essere compilati:\n"; msg += "__________________________________\n"; errorMsg += alert(msg + errorMsg + "\n"); return false; } CheckCodiceFiscale(document.frmEnquiry.cod_fisc.value); } // --> </script> <body> ...........