Ver Mensaje Individual
  #5 (permalink)  
Antiguo 28/09/2010, 12:16
Avatar de ylellan
ylellan
 
Fecha de Ingreso: mayo-2010
Ubicación: en un lugar de Veracruz
Mensajes: 432
Antigüedad: 14 años, 9 meses
Puntos: 36
Respuesta: validar campos especificos

que te parece un poco de javascript corazon:

Código HTML:
Ver original
  1. <head><title>hola</head>
  2. function validar(formulario)
  3. {
  4. if(formulario.nombre.value=='')
  5. {
  6. alert("CAMPO OBLIGATORIO");
  7. formulario.nombre.focus();
  8. return false;
  9. }
  10. if(formulario.pwd.value=='')
  11. {
  12. alert("CAMPO OBLIGATORIO");
  13. formulario.pwd.focus();
  14. return false;
  15. }
  16. return true;
  17. }
  18. </head>
  19. <form method="post" action="otra.php" onsubmit="validar(this)">
  20. NOmbre:<input type="text" name="text"><br>
  21. PWD: <input type="password" name="pwd"><br>
  22. <input type="submit" value="ENVIAR">
  23. </form>
  24. </body>
  25. </html>