baoming.jsp 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <%@ page language="java" contentType="text/html; charset=UTF-8"
  2. pageEncoding="UTF-8"%>
  3. <!DOCTYPE html>
  4. <html>
  5. <head>
  6. <meta charset="UTF-8">
  7. <title>校运会报名</title>
  8. <style type="text/css">
  9. *{ margin: 0;
  10. padding: 0;
  11. }
  12. body{
  13. background: linear-gradient(to top right, white 0%, skyblue 98%,blue 100%);
  14. font-family: "宋体";
  15. }
  16. h1{
  17. color: white;
  18. margin-left: 20px;
  19. margin-top: 15px;
  20. }
  21. h4{ color: white;
  22. margin-left: 20px;
  23. }
  24. .a{
  25. height: 20px;
  26. width: 95%;
  27. background: linear-gradient(to bottom, white 25%, gray 100%);
  28. margin-top: 10px;
  29. margin-left: 20px;
  30. }
  31. .b{
  32. height: 600px;
  33. width: 330px;
  34. margin: 10px 0 0 15px;
  35. line-height: 20px;
  36. color: green;
  37. }
  38. .d{
  39. height: 630px;
  40. width: 450px;
  41. margin: -590px 0 0 375px;
  42. }
  43. form{height: 600px;
  44. width: 550px;
  45. }
  46. table{margin:30px 0 0 70px;
  47. line-height: 50px;
  48. }
  49. </style>
  50. </head>
  51. <body>
  52. <h1>
  53. 深圳信息职业技术学院校运会报名
  54. </h1>
  55. <h4>Shenzhen Vocational and Technical College of Information Enrollment for School Games</h4>
  56. <div class="a"></div>
  57. <div class="b"></div>
  58. <div class="c"></div>
  59. <div class="d">
  60. <form action="enter.do" method="post">
  61. <fieldset style="width: 450px;height: 600px;">
  62. <legend>报名信息</legend>
  63. <table border="0" cellspacing="0" cellpadding="20">
  64. <tr>
  65. <td>
  66. 姓名:<input type="text" name="name">
  67. </td>
  68. </tr>
  69. <tr>
  70. <td>
  71. 学号:<input type="text" name="num">
  72. </td>
  73. </tr>
  74. <tr>
  75. <td>
  76. 班级:<input type="text" name="class0">
  77. </td>
  78. </tr>
  79. <tr>
  80. <td>
  81. 性别:
  82. <input type="radio" name="sex" value="男">男
  83. <input type="radio" name="sex" value="女">女
  84. </td>
  85. </tr>
  86. <tr>
  87. <td>
  88. 联系电话:<input type="text" name="telephone">
  89. </td>
  90. </tr>
  91. <tr>
  92. <td>
  93. 请选择报名组别:<select name="group" id="province" runat="server" onchange="selectprovince(this);" style=" width:95px;"></select>
  94. </td>
  95. </tr>
  96. <tr>
  97. <td>
  98. 请选择报名项目:<select name="project" id="city" runat="server" style=" width:95px;"></select>
  99. </td>
  100. </tr>
  101. <tr>
  102. <td>
  103. <input type="submit" value="提交报名信息">
  104. </td>
  105. </tr>
  106. </table>
  107. </fieldset>
  108. </form>
  109. <script type="text/javascript">
  110. var list1 = new Array;
  111. var list2 = new Array;
  112. list1[list1.length] = "学生组";
  113. list1[list1.length] = "教工青年组";
  114. list1[list1.length] = "教工中年组";
  115. list1[list1.length] = "教工老年组";
  116. list2[list2.length] = new Array("100米", "200米", "400米", "800米", "1500米", "3000米", "4×100米接力", "跳高","三级跳远", "铅球");
  117. list2[list2.length] = new Array("100米", "800米", "跳高","跳远","铅球");
  118. list2[list2.length] = new Array("60米", "800米", "跳高","跳远","铅球");
  119. list2[list2.length] = new Array("60米", "50米托球跑","跳远","铅球");
  120. var ddlProvince = document.getElementById("province");
  121. var ddlCity = document.getElementById("city");
  122. for(var i =0;i<list1.length; i++)
  123. {
  124. var option = document.createElement("option");
  125. option.appendChild(document.createTextNode(list1[i]));
  126. option.value = list1[i];
  127. ddlProvince.appendChild(option);
  128. //city initialize
  129. var firstprovince = list2[0];
  130. for (var j = 0; j < firstprovince.length; j++) {
  131. var optioncity = document.createElement("option");
  132. optioncity.appendChild(document.createTextNode(firstprovince[j]));
  133. optioncity.value = firstprovince[j];
  134. ddlCity.appendChild(optioncity);
  135. }
  136. }
  137. function indexof(obj,value)
  138. {
  139. var k=0;
  140. for(;k<obj.length;k++)
  141. {
  142. if(obj[k] == value)
  143. return k;
  144. }
  145. return k;
  146. }
  147. function selectprovince(obj) {
  148. ddlCity.options.length = 0;//clear
  149. var index = indexof(list1,obj.value);
  150. var list2element = list2[index];
  151. for(var i =0;i<list2element.length; i++)
  152. {
  153. var option = document.createElement("option");
  154. option.appendChild(document.createTextNode(list2element[i]));
  155. option.value = list2element[i];
  156. ddlCity.appendChild(option);
  157. }
  158. }
  159. </script>
  160. </div>
  161. </body>
  162. </html>