dsr95

HTML js lab

Feb 3rd, 2015
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.46 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4.  
  5. <title>DSRLab2</title>
  6.  
  7. <script type="text/javascript">
  8. function validacion()
  9. { //open function
  10. var nombre
  11. var apellido
  12.  
  13. nombre = document.form1.txtnombre.length
  14. apellido = document.form1.txtapellido.length
  15. if (nombre < 1)
  16. {
  17. alert("Por favor ingrese su nombre");
  18. }
  19. else if (apellido < 1)
  20. {
  21. alert("Por favor ingrese su apellido");
  22. }
  23. }//end function
  24. </script>
  25.  
  26. </head>
  27.  
  28. <body bgcolor="ff99ff">
  29.  
  30. <h1>Formulario General:</h1>
  31.  
  32. <form name="form1">
  33.  
  34.  
  35. Nombre: <input type="text" name="txtnombre">
  36. <br> <br>
  37. Apellido Paterno: <input type="text" name="txtapellido">
  38. <br> <br>
  39. Correo Electronico: <input type="text" name="txtcorreo">
  40. <br> <br>
  41. Pueblo: <input type="text" name="txtPueblo"> Pais: <input type="text" name="txtpais">
  42. <br> <br>
  43. Rango de edad: <br>
  44. <input type="radio" name="rango" value="menor de 20">Menor de 20
  45. <br>
  46. <input type="radio" name="rango" value="20 - 40">20 - 40
  47. <br>
  48. <input type="radio" name="rango" value="40 - 60">40 - 60
  49. <br>
  50. <input type="radio" name="rango" value="60 o mas">60 o mas
  51. <br> <br>
  52.  
  53.  
  54.  
  55.  
  56. Pasatiempo favoritos
  57. <br>
  58. <input type="checkbox" name="pasatiempos">Viajar
  59. <br>
  60. <input type="checkbox" name="musica">Musica
  61. <br>
  62. <input type="checkbox" name="videojuegos">Video Juegos
  63. <br>
  64. <input type="checkbox" name="playa">Playa
  65. <br>
  66. <input type="checkbox" name="ejercicios">Ejercicios
  67. <br> <br>
  68.  
  69. <table>
  70. <th>
  71. Escriba su opinion sobre su programa de estudios:
  72. </th>
  73. <td>
  74. <textarea rows="4" cols="50">
  75. </textarea>
  76. </td>
  77. <th>
  78. Sugerencias:
  79. <th>
  80. <td>
  81.  
  82. <textarea rows="4" cols="50">
  83. </textarea>
  84. </td>
  85. </table>
  86. <br>
  87. &iquest;Cuantas horas navega en internet diariamente? (Aproximado)
  88. <br>
  89. <br>
  90.  
  91. <select>
  92. <option value="1 hora">1 hora</option>
  93. <option value="2 horas">2 horas</option>
  94. <option value="3 horas">3 horas</option>
  95. <option value="4 horas">4 horas</option>
  96. <option value="5 horas">5 horas</option>
  97. <option value="6 horas">6 horas</option>
  98. <option value="7 horas">7 horas</option>
  99. <option value="8 horas">8 horas</option>
  100. <option value="9 horas">9 horas</option>
  101. <option value="10 horas">10 horas</option>
  102. </select>
  103.  
  104. <br>
  105. <br>
  106. <input type="submit" name="enviar" value="Enviar Formulario" onclick="validacion()">
  107.  
  108. <input type="submit" name="borrar" value="Borrar Formulario">
  109.  
  110.  
  111. </body>
  112.  
  113. </html>
Advertisement
Add Comment
Please, Sign In to add comment