Advertisement
Guest User

Untitled

a guest
Aug 12th, 2012
279
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. function valida_envia(){
  4.  
  5. //valido el nombre
  6.  
  7. if (document.Formulario.usuario.value.length==0){
  8.  
  9. alert("Tiene que escribir su nombre");
  10.  
  11. document.Formulario.nombre.focus();
  12.  
  13. return 0;
  14.  
  15. }
  16.  
  17.  
  18.  
  19. //valido el email
  20.  
  21. if (document.Formulario.email.value.length==0)
  22.  
  23. {
  24.  
  25. var sim='@.';
  26.  
  27. alert("E-mail no valido");
  28.  
  29. document.Formulario.email.focus();
  30.  
  31. return 0;
  32.  
  33. }
  34.  
  35.  
  36.  
  37. //valido el comentario
  38.  
  39. if (document.Formulario.comentario.value.length==0){
  40.  
  41. alert("No ha escrito nada para enviar")
  42.  
  43. document.Formulario.email.focus()
  44.  
  45. return 0;
  46.  
  47. }
  48.  
  49.  
  50.  
  51. //el formulario se envia
  52.  
  53. alert("Muchas gracias por enviar el formulario");
  54.  
  55. document.Formulario.submit();
  56.  
  57. }
  58.  
  59. </script>
  60.  
  61. //AQUI va el formulario que se coloca en CONTACTO.html
  62.  
  63. <form action="step2.php" method="post" name="Formulario" >
  64.  
  65. Nombre<br /><br /><input type="text" name="usuario" onselect="Validar(this);" /><br /><br />
  66.  
  67. Email<br /><br /><input type="text" name="email" /><br /><br />
  68.  
  69. Comentario<br /><br /><textarea rows="7" cols="70" name="comentario" ></textarea><br />
  70.  
  71. <input type="button" value="Enviar" onclick="valida_envia()" />
  72.  
  73. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement