![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
02/08/2004, 00:31
|
![Avatar de KarlanKas](http://static.forosdelweb.com/customavatars/avatar11549_2.gif) | Moderador extraterrestre | | Fecha de Ingreso: diciembre-2001 Ubicación: Madrid
Mensajes: 6.987
Antigüedad: 23 años, 1 mes Puntos: 61 | |
Un ejemplo:
<html>
<head>
<title>Untitled</title>
<script>
function chequeo(){
formulario=document.forms[0];
elementos=formulario.elements;
for(a=0;a<elementos.length;a++){
if(elementos[a].type=="text" && elementos[a].value==""){
alert("La caja de texto cuyo nombre es "+elementos[a].name+" está vacía.\nPor favor rellenela");
return false;
}
}
}
</script>
</head>
<body>
<form action="javascript:alert('Enviandooo....!');" onsubmit="return chequeo()">
<input type="text" name="pepe"><br>
<input type="text" name="pepe1"><br>
<input type="text" name="pepe2"><br>
<input type="text" name="pepe3"><br>
<input type="text" name="pepe4"><br>
<input type="text" name="pepe5"><br>
<input type="text" name="pepe6"><br>
<input type="text" name="pepe7"><br>
<input type="text" name="pepe8"><br>
<input type="text" name="pepe9"><br>
<input type="text" name="pepe10"><br>
<input type="text" name="pepe11"><br>
<input type="submit">
</form>
</body>
</html>
__________________ Cómo escribir
No hay pregunta tonta, sino tonto que quiere seguir en la ignorancia. |