Ver Mensaje Individual
  #6 (permalink)  
Antiguo 26/01/2010, 19:53
Avatar de dcreate
dcreate
 
Fecha de Ingreso: octubre-2009
Ubicación: Veracruz
Mensajes: 536
Antigüedad: 14 años, 6 meses
Puntos: 22
Respuesta: ayuda con validacion en php de formulario

ps no se si te sirva pero yo valido los campos con javascript, si te sirve aki ta un poco de codigo, suerte

Código PHP:
Ver original
  1. <html>
  2. <head><title>VALIDAR</title>
  3. <script>
  4. function validar(form)
  5. {
  6. if(form.nombre.value='')
  7. {
  8. alert("FALTA CAMPO\n-NOMBRE");
  9. form.nombre.focus();
  10. return false;
  11. }
  12. if(form.domicilio.value='')
  13. {
  14. alert("FALTA CAMPO\n-DOMICILIO");
  15. form.domicilio.focus();
  16. return false;
  17. }
  18. return true;
  19. }
  20. </script>
  21. </head>
  22. <body>
  23. <form method="post" action="procesar" onsubmit="return validar(this)">
  24. <input type="text" name="nombre">
  25. <input type="text" name="domicilio">
  26. <input type="submit" name="enviar" value="enviar">
  27. </form>
  28. </body>
  29. </html>