Advertisement
Guest User

js

a guest
Nov 24th, 2014
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2.  
  3. <html lang="en">
  4.     <head>
  5.         <meta charset="utf-8" />
  6.         <title>הרשמה</title>
  7.         <link href="styles/main.css" rel="stylesheet"/>
  8.             <script>
  9.                
  10.  
  11.                 function check() {
  12.  
  13.                     if (document.myForm.firstName.value.length < 2) {
  14.                         window.alert("השם קצר מידי");
  15.                         document.myForm.firstName.focus();
  16.                         document.myForm.firstName.select();
  17.                         return false;
  18.                     }
  19.                     else {
  20.                         if (document.myForm.lastName.value.length < 2) {
  21.                             window.alert("שם המשפחה קצר מידי");
  22.                             document.myForm.lastName.focus();
  23.                             document.myForm.lastName.select();
  24.                             return false;
  25.                         }
  26.                         else {
  27.  
  28.                             if (document.myForm.id.value.length < 9) {
  29.                                 window.alert("תעודת הזהות קצרה 9 תווים");
  30.                                 document.myForm.id.focus();
  31.                                 document.myForm.id.select();
  32.  
  33.                                 return false;
  34.  
  35.                             }
  36.  
  37.  
  38.  
  39.                             else {
  40.  
  41.  
  42.                                 if (document.myForm.password.value.length < 8) {
  43.                                     window.alert("הסיסמה קצרה מ 8 תווים");
  44.                                     document.myForm.password.focus();
  45.                                     document.myForm.password.select();
  46.                                     return false;
  47.                                 }
  48.                                 else {
  49.  
  50.                                     var checkId = document.myForm.id.value;
  51.  
  52.                                     var sum = 0;
  53.                                     var temp = 0;
  54.                                    
  55.                                    }
  56.                                         for (var i = 0; i < checkId.length - 1; i++) {
  57.  
  58.  
  59.                                             if (i % 2 === 0) {
  60.  
  61.                                                 sum += parseInt(checkId.charAt(i));
  62.                                             }
  63.                                             else {
  64.  
  65.                                               temp = parseInt(checkId.charAt(i)) * 2;
  66.                                                
  67.                                                 sum += temp / 10 + temp % 10;
  68.                                             }
  69.  
  70.                                         }
  71.  
  72.                                     window.alert(sum);
  73.                         sum=parseInt(sum);
  74.                      window.alert(sum);
  75.                                        
  76.                          var checker=10-sum%10;
  77.                                  window.alert(checker);
  78.  
  79.                                      
  80.                                     if (sum%10===0&&parseInt(checkId.charAt(8))===0||parseInt(checkId.charAt(8))===checker)
  81.                      {
  82.                                         window.alert("תעודת הזהות בסדר ");
  83.                                         return true;
  84.  
  85.                                     }
  86.                                    
  87.  
  88.                                     else {
  89.                                         window.alert("תעודת הזהות אינה קיימת ");
  90.                                         document.myForm.id.focus();
  91.                                         document.myForm.id.select();
  92.                                         return false;
  93.                                     }
  94.                                 }
  95.  
  96.                             }
  97.                         }
  98.  
  99.                     }
  100.  
  101.  
  102.                  
  103.  
  104.  
  105.  
  106.             </script>
  107.     </head>
  108.     <body class="body2">
  109.  
  110.         <ul>
  111.             <li><a href="#item1" class="bl"> רשום כבר ? כניסה  </a></li>                          
  112.         </ul>                                                                
  113.  
  114.         <table  style="background-color: #e2dada ;margin-left:30%; width:767px;margin-top: 5px "  >
  115.             <tr>
  116.                 <td><img src="styles/photos/logo.png" alt="error" width="200px" height="100px"  ></td>
  117.             </tr>
  118.         </table>
  119.         <ul style="margin-left:30%">
  120.             <li><a  href="" class="bl">הוסף סידרה בבקשה  </a></li>
  121.             <li><a href="#item1" class="bl">ג'אנר </a></li>
  122.            <li><a href="odot.html" class="bl">אודות</a></li>
  123.            <li><a href="favorites.html" class="bl"> מועדפים </a></li>
  124.            <li><a href="gl.html" class="bl">גלריה</a></li>
  125.            <li><a href="index.html" class="bl"> עמוד הבית </a></li>
  126.  
  127.  
  128.        </ul>
  129.        <form action="" method="get" name="myForm" onsubmit="return check()">
  130.  
  131.            <table class="s">
  132.                 <tr>      
  133.                    <td> <input type="text" name="id" value="הכנס תעודת זהות" />תעודת זהות</td>                                
  134.                </tr>
  135.                <tr>
  136.                    <td> <input type="text" name="lastName" value="הכנס שם משפחה" />שם משפחה </td>                      
  137.                </tr>
  138.                <tr>
  139.                    <td> <input type="text" name="firstName" value="הכנס שם פרטי" />שם פרטי</td>
  140.                </tr>
  141.              
  142.                <tr>
  143.                    <td> <input type="password" name="password" value="123456789" />סיסמה      </td>    
  144.                </tr>  
  145.                <tr>      
  146.                    <td> <input type="text" name="bd" value="הכנס  תאריך לידה" />תאריך לידה</td>                                
  147.                </tr>
  148.                <tr>  
  149.                    <td >
  150.                        ג'אנר אהוב:
  151.                         </br>
  152.                         <input type="checkbox" name="genre" id="g0" value="comedy"/>קומדיה </br>
  153.                         <input type="checkbox" name="genre" id="g2" value="comedy"/>אימה </br>
  154.                         <input type="checkbox" name="genre" id="g3" value="comedy"/>אקשן </br>
  155.                         <input type="checkbox" name="genre" id="g4" value="comedy"/>מסעות </br>
  156.                         <input type="checkbox" name="genre" id="g5" value="comedy"/>פשע </br>
  157.                         <input type="checkbox" name="genre" id="g6" value="comedy"/>דרמה </br>
  158.                         <input type="checkbox" name="genre" id="g7" value="comedy"/>ביוגרפיה </br>
  159.                         <input type="checkbox" name="genre" id="g8" value="comedy"/>דקומנטרי</br>
  160.  
  161.  
  162.                     </td>
  163.                 </tr>
  164.  
  165.                 <tr>                
  166.                     <td>
  167.                         שפה:
  168.                         </br>
  169.                         <input type="radio" name="geneder" value="male" checked />עברית
  170.                         <input type="radio" name="geneder" value="female" />english
  171.                         <input type="radio" name="geneder" value="female" />русский
  172.                     </td>
  173.                 <tr></tr>
  174.  
  175.  
  176.            
  177.         <tr>
  178.         <td>
  179.             <input type="submit" name="submit" value="שלח"/>
  180.             <input type="reset" name="reset" value="נקה"/>
  181.         </td>
  182.  
  183.     </tr>
  184.             </table>
  185. </form>
  186.  
  187. </body>
  188. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement