Parte de "function valida()".
Código HTML:
error=0; mensaje=""; fecha = document.registro.fecha.value; fecha2 = document.registro.fecha2.value; if(fecha > fecha2){ document.registro.fecha.style.background = '#005F4F'; document.registro.fecha2.style.background = '#005F4F'; mensaje = mensaje + "\n- Fecha de Termino No Puede Ser Mayor a la de Inicio"; error=1; } if(error==1){ alert(mensaje); return false; } else { document.registro.envio(); }
Código HTML:
<tr> <td> <b>DE:</b></td> <td> <div> <input type="text" name="fecha" size="12" value="Año/Mes/Día" onclick="repinta_fecha()"> </div> </td> <td> <input type="text" size="5" maxlength="5" name="hora" value="00:00" onclick="repinta_hora()"> </td> </tr> <tr> <td> <b>A:</b></td> <td> <div> <input type="text" name="fecha2" size="12" value="Año/Mes/Día" onclick="repinta_fecha2()"> </div> </td> <td> <input type="text" size="5" maxlength="5" name="hora2" value="00:00" onclick="repinta_hora2()"> </td></tr>