Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/05/2006, 01:54
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 22 años, 2 meses
Puntos: 772
Hola sneider

A ver si te ayuda este código que tenía por ahí:
Código:
<html>
<head>
<script type="text/javascript">
function nif(dni) {
  numero = dni.substr(0,dni.length-1);
  let = dni.substr(dni.length-1,1);
  numero = numero % 23;
  letra='TRWAGMYFPDXBNJZSQVHLCKET';
  letra=letra.substring(numero,numero+1);
  if (letra!=let) 
    alert('Dni erroneo');
}
</script>
</head>
<body>
<input type="text" onblur="nif(this.value)" />
</body>
</html>
Saludos,