Ver Mensaje Individual
  #13 (permalink)  
Antiguo 02/07/2003, 01:07
Avatar de KarlanKas
KarlanKas
Moderador extraterrestre
 
Fecha de Ingreso: diciembre-2001
Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 22 años, 5 meses
Puntos: 61
Y esta forma es compatible con NS 4.7

Código:
<html>
<body>
<SCRIPT language=JavaScript>

aviso=new Array("","Lectura","Fecha")
function valida() {
for (a=1;a<3;a++){
if (document.forms[0].elements[a].value == ""){

  	alert ("El ingreso de la "+aviso[a]+" es obligatorio.");
    document.forms[0].elements[a].focus();
  	return false;
  }

}
document.forms[0].submit();
}

</SCRIPT>


<form name="lectura" method="post" action="add_reg.php">
Cuenta :<input type="Text" name="cta" value="<? echo $cta;?>"><br>
Lectura:<input type="Text" name="lec"><br>
Fecha  :<input type="Text" name="fec"><br>
<input type="button"   onClick="return valida();" name="enviar" value="Aceptar información" >
</form>
</body>
</html>
__________________
Cómo escribir

No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia.