Advertisement
Guest User

Untitled

a guest
Sep 20th, 2017
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 8.10 KB | None | 0 0
  1. <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Register.aspx.cs" Inherits="Register" Title="Nadav's Suissa Registration Page" %>
  2.  
  3. <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
  4.     <script type="text/javascript" >
  5.      
  6.         function FirstNameIsValid() {
  7.      
  8.             st = document.getElementById("fname").value;
  9.            var ok=true;
  10.            if   (Number(st))
  11.            {
  12.             alert("You must enter a valid First Name(not numbers only letters!)");
  13.                 document.getElementById("fname").focus();
  14.                ok=false;
  15.                }
  16.             if (st == "") {
  17.                 alert("You must enter a First Name");
  18.                 document.getElementById("fname").focus();
  19.                ok=false;
  20.             }
  21.              return ok;
  22.         }
  23.      
  24.         function LastNameIsValid() {
  25.      
  26.             st = document.getElementById("lname").value;
  27.            var ok=true;
  28.             if   (Number(st))
  29.            {
  30.             alert("You must enter a valid Last Name(not numbers only letters!)");
  31.                 document.getElementById("fname").focus();
  32.                ok=false;
  33.                }
  34.             if (st == "") {
  35.                 alert("You must enter a last name");
  36.                document.getElementById("lname").focus();
  37.                ok=false;
  38.             }
  39.                  return ok;
  40.         }
  41.        
  42.         function AgeIsValid() {
  43.      
  44.             st = document.getElementById("yearBorn").value;
  45.             var ok=true;
  46.             if (st == "") {
  47.                 alert("You must enter an age(year)");
  48.                 document.getElementById("yearBorn").focus();
  49.                 ok=false;
  50.             }
  51.             if (isNaN(st)) {
  52.                 alert("Error, you must enter an apropriate age (year)");
  53.                document.getElementById("yearBorn").focus();
  54.              ok=false;
  55.             }
  56.             else {
  57.      
  58.                 if (Number(st) < 1930 || Number(st) > 2012) {
  59.                     alert("Enter an valid year");
  60.                     document.getElementById("yearBorn").focus();
  61.                    ok=false;
  62.                 }
  63.             }
  64.             return ok;
  65.         }
  66.        
  67.         function PhoneIsValid() {
  68.            
  69.             var st = document.getElementById("Select1").options.value + "-" + document.getElementById("tel").value;
  70.             var st2 = document.getElementById("tel").value;
  71.     var ok=true;
  72.             if (isNaN(st2)) {
  73.                 alert("Error: you must enter numbers only in phone!!");
  74.                 document.getElementById("tel").focus();
  75.                ok=false;
  76.             }
  77.      
  78.             if (st2.length != 7) {
  79.                 alert("You must enter a 7 digit number phone number");
  80.                 document.getElementById("tel").focus();
  81.               ok=false;
  82.             }
  83.      
  84.             if (st2 == "") {
  85.                 alert("You must enter a phone number");
  86.                  document.getElementById("tel").focus();
  87.                ok=true;
  88.             }
  89.            
  90.      
  91.             return ok;
  92.         }
  93.      
  94.         function EmailIsValid() {
  95.      
  96.             var stEmail = document.getElementById("email").value;
  97.             var ok=true;
  98.             if (stEmail == "") {
  99.                 alert("You must enter an email");
  100.                  document.getElementById("email").focus();
  101.                 ok=true;
  102.             }
  103.             else {
  104.                 if (stEmail.indexOf("@") < 0) {
  105.                    alert("Email must have @");
  106.                   document.getElementById("email").focus();
  107.                   ok=false;
  108.                }
  109.                if (stEmail.indexOf(".") < 0) {
  110.                    alert("Email must have (.)");
  111.                    document.getElementById("email").focus();
  112.                }
  113.            }
  114.            return ok;
  115.        }
  116.  
  117.        function isvalid()
  118.        {
  119.            if ( FirstNameIsValid() && LastNameIsValid() && PhoneIsValid() && EmailIsValid() && AgeIsValid();
  120.                return true;
  121.                return false;
  122.        }
  123.        function submitForm()
  124.        {
  125.        if (isvalid())
  126.            form1.submit();
  127.        }
  128.    </script>
  129.  
  130.     <form  name="form1" id="form1" action="Register.aspx" method="post" onsubmit="submitForm()">
  131.  
  132. <h1>דף הרשמה\Registration Page</h1>
  133.     <center style="color: #000000">
  134.         <table style="width: 40%;" border="1">
  135.        
  136.             <tr>
  137.                 <td style="color: #0000FF">
  138.                     שם פרטי:
  139.                 </td>
  140.                 <td>
  141.                     <center><input id="fname" name="fname" style="color: #0000FF"   /></center><span
  142.                        style="color: #0000FF">
  143.                     </span>
  144.                 </td>
  145.  
  146.             </tr>
  147.             <tr>
  148.                 <td style="color: #0000FF">
  149.                     שם משפחה:
  150.                 </td>
  151.                 <td>
  152.                     <center> <input id="lname" name="lname" style="color: #0000FF"  /></center><span
  153.                        style="color: #0000FF">
  154.                     </span>
  155.                 </td>
  156.  
  157.             </tr>
  158.             <tr>
  159.                 <td style="color: #0000FF">
  160.                     טלפון:
  161.                 </td>
  162.                 <td>
  163.                      <center><input id="tel" name="tel" dir="ltr" style="color: #0000FF"/><span
  164.                        style="color: #0000FF"> -
  165.                     </span>
  166.                     &nbsp;<select id="Select1" name="Select1" style="color: #0000FF" >
  167.                         <option value="02" >02</option>
  168.                         <option value="03">03</option>
  169.                         <option value="05">05</option>
  170.                         <option value="08">08</option>
  171.                         <option value="09" selected="selected">09</option>
  172.                         <option value="077">077</option>
  173.                     </select></center>
  174.                     <center></center><span style="color: #0000FF"> </span>
  175.                 </td>
  176.                 <!--
  177.                <td>
  178.                    &nbsp;******************
  179.                </td>
  180.                -->
  181.             </tr>
  182.            
  183.             <tr>
  184.                 <td style="color: #0000FF">
  185.                     אימייל
  186.                 </td>
  187.                 <td>
  188.                      <center><input id="email" name="email" style="color: #0000FF" /></center><span
  189.                        style="color: #0000FF">
  190.                     </span>
  191.                 </td>
  192.  
  193.             </tr>
  194.  
  195.             <tr>
  196.                 <td style="color: #0000FF; height: 13px;">
  197.                     שנת לידה
  198.                 </td>
  199.                 <td style="height: 13px">
  200.                    <center><input id="yearBorn" name="yearBorn" style="color: #0000FF" /></center><span
  201.                        style="color: #0000FF">
  202.                     </span>
  203.                 </td>
  204.  
  205.             </tr>
  206.             <tr>
  207.                 <td style="color: #0000FF">
  208.                     שם משתמש</td>
  209.                 <td>
  210.                      <center><input id="username" name="username" style="color: #0000FF" /></center><span
  211.                        style="color: #0000FF">
  212.                     </span>
  213.                 </td>
  214.            
  215.             </tr>
  216.             <tr>
  217.                 <td style="color: #0000FF">
  218.                     סיסמא
  219.                 </td>
  220.                 <td>
  221.                     <center><input id="password" name="password" type="password" style="color: #0000FF" /></center><span
  222.                        style="color: #0000FF"> </span>
  223.                 </td>
  224.  
  225.             </tr>
  226.  
  227.    </table>
  228. <select id="gender" name="gender">
  229.   <option value="male">זכר</option>
  230.   <option value="female">נקבה</option>
  231. </select>
  232.     </center>
  233.     <br />
  234.    
  235.     <input id="Reset1" type="reset" value="נקה" />&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input id="Submit1" type="submit"  value="שלח" />
  236.      </form>
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249. </asp:Content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement