Ver Mensaje Individual
  #2 (permalink)  
Antiguo 29/11/2003, 12:08
Avatar de JavierB
JavierB
Colaborador
 
Fecha de Ingreso: febrero-2002
Ubicación: Madrid
Mensajes: 25.052
Antigüedad: 23 años
Puntos: 772
Hola, v_i_n_i_c_i_o.

Prueba esto:
Código PHP:
<html>
<
head>
<
script>
function 
validar() {
    
num=document.getElementById('pru').value;
    
patron=/[0-9]{1}-[0-9]{4}-[0-9]{4}/;
    
alert(patron.test(num));
}
</script>
</head>

<body>
<input type="text" id="pru">
<input type="button" onclick="validar()">
</body>
</html> 
Saludos,