Advertisement
Parasect

Untitled

Dec 6th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.44 KB | None | 0 0
  1. <%--
  2. Document : index
  3. Created on : 29/11/2015, 07:23:51
  4. Author : Arthur
  5. --%>
  6.  
  7. <%@page contentType="text/html" pageEncoding="UTF-8"%>
  8.  
  9. <html>
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  12. <title>מבחן בתכנות בסביבת אינטרנט</title>
  13. <script type="text/javascript">
  14. function checkForm()
  15. {
  16. var name = document.forms["muamadForm"]["userName"].value;
  17. var age = document.forms["muamadForm"]["gil"].value;
  18.  
  19. if(!checkName(name))
  20. {
  21. alert("Name only in English. First letter Capital.");
  22. document.forms["muamadForm"]["userName"].focus();
  23. document.forms["muamadForm"]["userName"].select();
  24. return;
  25. }
  26. if(!checkAge(age))
  27. {
  28. alert("Age from 21 to 50.");
  29. document.forms["muamadForm"]["userName"].focus();
  30. document.forms["muamadForm"]["userName"].select();
  31. return;
  32. }
  33. if(!checkPhone())
  34. {
  35. alert("02 or 03 or 04 + and 7 numbers with 0 first.");
  36. return;
  37. }
  38. if(!checkMazav())
  39. {
  40. alert("Select at least 1 mazav mishpahti.");
  41. return;
  42. }
  43. if(!checkLanguages())
  44. {
  45. alert("Select at least 2 languages.");
  46. return;
  47. }
  48. if(!checkJob())
  49. {
  50. alert("Regions all different. Select at least one");
  51. return;
  52. }
  53. if(!checkExperience())
  54. {
  55. alert("Experience Box 20 letters+.");
  56. document.forms["muamadForm"]["nisayonBox"].focus();
  57. document.forms["muamadForm"]["nisayonBox"].select();
  58. return;
  59. }
  60.  
  61. }
  62. function checkName(name)
  63. {
  64. var pattern = /^[A-Z]([a-zA-Z]*)$/;
  65. return pattern.test(name);
  66. }
  67. function checkAge(age)
  68. {
  69. var ageInt = parseInt(age);
  70. return (ageInt > 20 && ageInt < 51);
  71. }
  72. function checkPhone()
  73. {
  74. var a = document.forms["muamadForm"]["kidomet"].value;
  75. if (!(a === "02" || a === "03" || a === "04"))
  76. return false;
  77. var b = document.forms["muamadForm"]["number"].value;
  78. if (b.charAt(0) === '0')
  79. return false;
  80. var pattern = /^[0-9]+$/;
  81. if (!b.test(pattern))
  82. {
  83. return false;
  84. }
  85. if (b.length !== 7)
  86. return false;
  87. return true;
  88. }
  89. function checkMazav()
  90. {
  91. for (var i = 0; i < 4; i++)
  92. {
  93. if(document.forms.muamadForm.mazav[i].checked)
  94. {
  95. return true;
  96. }
  97. }
  98. return false;
  99. }
  100.  
  101. function checkLanguages()
  102. {
  103. var count = 0;
  104. if(document.muamadForm.safa1.checked)
  105. {
  106. count++;
  107. }
  108. if(document.muamadForm.safa2.checked)
  109. {
  110. count++;
  111. }
  112. if(document.muamadForm.safa3.checked)
  113. {
  114. count++;
  115. }
  116. if(document.muamadForm.safa4.checked)
  117. {
  118. count++;
  119. }
  120. if(count < 2)
  121. return false;
  122. return true;
  123. }
  124.  
  125. function checkJob()
  126. {
  127. var a1 = document.muamadForm.ezor1.selectedIndex;
  128. var a2 = document.muamadForm.ezor2.selectedIndex;
  129. var a3 = document.muamadForm.ezor3.selectedIndex;
  130. if(a1 !== a2 && a2 !== a3 && a1 !== a3 && a1 !==0 && a2 !==0 && a3 !==0)
  131. return true;
  132. return false;
  133. }
  134. function checkExperience()
  135. {
  136. return (document.forms["muamadForm"]["nisayonBox"].value.length > 19);
  137. }
  138. </script>
  139. </head>
  140. <body bgColor="azure">
  141. <div dir="rtl" align="right">
  142.  
  143. <center> <B><U>
  144. <font size="5" color="blue">טופס הגשת מועמדות</font><br>
  145. <font size="5" color="blue">למשרת מהנדס תוכנה בכיר בחברת הייטק</font>
  146. </U></B><br><br><br>
  147. </center>
  148. </div>
  149. <form name="muamadForm" method="post" action="" onsubmit = "return checkForm()">
  150.  
  151. <table dir="rtl" align="center" border="0">
  152. <tr>
  153. <td>
  154. <b><font size="3" color="blue">שם מועמד:</font></b></td>
  155. <td><input type="text" name="userName"></td>
  156. </tr>
  157. <tr>
  158. <td><b><font size="3" color="blue">גיל:</font></b></td>
  159. <td><input type="text" name="gil"></td>
  160. </tr>
  161. <tr>
  162. <td>
  163. <b><font size="3" color="blue">מספר טלפון:</font></b></td>
  164. <td><input type="text" name="number"></td>
  165. <td><input type="text" name="kidomet"></td>
  166.  
  167. </tr>
  168. <tr>
  169. <td>
  170. <b><font size="3" color="blue">מצב משפחתי:</font></b>
  171. </td>
  172. <td>
  173. <input type="radio" name="mazav" value="ravak" />
  174. <font size="3" color="blue">רווק</font>
  175.  
  176.  
  177. <input type="radio" name="mazav" value="nasui" />
  178. <font size="3" color="blue">נשוי</font>
  179.  
  180.  
  181. <input type="radio" name="mazav" value="garush" />
  182. <font size="3" color="blue">גרוש</font>
  183.  
  184. <input type="radio" name="mazav" value="alman" />
  185. <font size="3" color="blue">אלמן</font>
  186. </td>
  187. </tr>
  188. <tr>
  189. <td>
  190. <b><font size="3" color="blue">שליטה בשפות תכנות:</font></b>
  191. </td>
  192. <td>
  193. <input type="checkbox" name="safa1" value="java" />
  194. <font size="3" color="blue">ג'אווה</font>
  195.  
  196.  
  197. <input type="checkbox" name="safa2" value="vb" />
  198. <font size="3" color="blue">ויזואל בייסיק</font>
  199.  
  200.  
  201. <input type="checkbox" name="safa3" value="asembler" />
  202. <font size="3" color="blue">אסמבלר</font>
  203.  
  204. <input type="checkbox" name="safa4" value="csharp" />
  205. <font size="3" color="blue">סי-שארפ</font>
  206. </td>
  207. </tr>
  208. <tr>
  209. <td><b><font size="3" color="blue">עדיפות לאיזור עבודה:</font></b></td>
  210. <td>
  211. <font size="3" color="blue">1.</font>&nbsp&nbsp
  212. <select name="ezor1">
  213. <option value="בחר איזור">בחר איזור</option>
  214. <option value="צפון הארץ">צפון הארץ</option>
  215. <option value="מרכז הארץ">מרכז הארץ</option>
  216. <option value="ירושלים">ירושלים</option>
  217. <option value="דרום הארץ">דרום הארץ</option>
  218. </select>&nbsp&nbsp
  219. <font size="3" color="blue">2.</font>&nbsp&nbsp
  220. <select name="ezor2">
  221. <option value="בחר איזור">בחר איזור</option>
  222. <option value="צפון הארץ">צפון הארץ</option>
  223. <option value="מרכז הארץ">מרכז הארץ</option>
  224. <option value="ירושלים">ירושלים</option>
  225. <option value="דרום הארץ">דרום הארץ</option>
  226. </select>&nbsp&nbsp
  227. <font size="3" color="blue">3.</font>&nbsp&nbsp
  228. <select name="ezor3">
  229. <option value="בחר איזור">בחר איזור</option>
  230. <option value="צפון הארץ">צפון הארץ</option>
  231. <option value="מרכז הארץ">מרכז הארץ</option>
  232. <option value="ירושלים">ירושלים</option>
  233. <option value="דרום הארץ">דרום הארץ</option>
  234. </select>
  235. </td>
  236. </tr>
  237. <tr>
  238. <td>
  239. <b><font size="3" color="blue">ניסיון תעסוקתי קודם:</font></b>
  240. </td>
  241. <td>
  242. <textarea rows="5" cols="30" name="nisayonBox"></textarea>
  243. </td>
  244.  
  245. </tr>
  246. <tr><td>&nbsp</td></tr>
  247. <tr><td>&nbsp</td></tr>
  248. <tr><td>&nbsp</td></tr>
  249. <tr>
  250. <td>&nbsp</td>
  251. <td>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
  252. <input type="submit" value="בדוק טופס">&nbsp&nbsp&nbsp&nbsp&nbsp
  253. <input type="reset" value="נקה">
  254. </td>
  255. </tr>
  256. </table>
  257.  
  258. </form>
  259. <br/><br/><br/>
  260.  
  261. </body>
  262. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement