Ver Mensaje Individual
  #16 (permalink)  
Antiguo 28/10/2009, 12:44
Avatar de Adler
Adler
Colaborador
 
Fecha de Ingreso: diciembre-2006
Mensajes: 4.671
Antigüedad: 18 años, 2 meses
Puntos: 126
Respuesta: Usando JS Calendar

Hola

No lo he probado, pero intentalo así

Código javascript:
Ver original
  1. <script language="JavaScript">
  2. function validar(c){
  3. chequearcedula(c)
  4. validaFecha(c)
  5. }
  6.  
  7.  
  8. //     
  9. function chequearcedula(c) {
  10. cedula=document.form1.cedula.value;
  11. if(cedula==""){
  12.             alert("Lo siento  "+document.form1.cedula.name+" no puede estar vacio");
  13.             document.form1.cedula.focus();
  14.             return false;
  15.             }
  16.             if(isNaN(cedula)){
  17.             alert("Lo siento  "+document.form1.cedula.name+" debe ser un numero valido");
  18.             document.form1.cedula.focus();
  19.             return false;
  20.             }else{
  21.             return true;}}
  22.  
  23. //
  24. function chequearfechas(f_desde,f_hasta) {
  25.  
  26. if(f_desde > f_hasta){
  27. alert("error")
  28. return false;
  29.  
  30.  
  31. } else {
  32. alert("bien")
  33. return true; }
  34. }
  35.  
  36. function validaFecha(c){  
  37.     var FechaMenor = c.f_desde.value;  
  38.     var FechaMayor = c.f_hasta.value;  
  39.   //alert(FechaMenor + " - " +FechaMayor)
  40.     if(!chequearfechas(FechaMenor, FechaMayor))  
  41.                alert("Error. La fecha NO es menor.");  
  42.  
  43.    else
  44.  
  45.  alert("OK. La fecha es menor.");  
  46. }  
  47.  
  48. </script>
  49. </head>
  50. <body>
  51. <form id="form1" name="form1" method="POST" action="" OnSubmit="return validar(this);">

Suerte
__________________
Los formularios se envían/validan con un botón Submit
<input type="submit" value="Enviar" style="background-color:#0B5795; font:bold 10px verdana; color:#FFF;" />