Ver Mensaje Individual
  #7 (permalink)  
Antiguo 22/12/2011, 07:15
jarjausroy
 
Fecha de Ingreso: diciembre-2011
Mensajes: 50
Antigüedad: 13 años, 3 meses
Puntos: 0
Respuesta: Validar textarea fecha en formulario

no ejecuta la funcion bien :S, e puesto lo siguiente

Código HTML:
<html> 
<head> 
   <SCRIPT LANGUAGE="JavaScript"> 

  function fecha(idCampo){ 
var datePat = /^(0[1-9]|1\d|2\d|3[1-2])\/(0[1-9]|1[0-2])\/\d{4}$/;                       

if (matchArray != null){
document.getElementById(idCampo).style.color="#000 ";
} else{ 
document.getElementById(idCampo).style.color="#f00 "; 
} 

</SCRIPT> 
</head> 

<body> 
<input type="text" id="acomprobar" onkeypress="fecha('acomprobar')"/>
</body> 
</html>