Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" %>
- <script runat="server">
- </script>
- <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
- <form action ="#" method ="get" onsubmit="return CheckForm()">
- <center>
- <br />
- <br />
- <h1 style="text-decoration: underline; color: #FF9966; text-align: center;"><b>הירשם</b></h1>
- <br />
- <br />
- <br />
- <table id = "table" >
- <tr>
- <td id ="td1"></td>
- <td ><input type ="text" id ="username" name = "username" />שם משתמש</td>
- </tr>
- <tr>
- <td id = "td2"> </td>
- <td ><input type ="password" id = "password" name = "password"/> סיסמא</td>
- </tr>
- <tr>
- <td id = "td5"></td>
- <td ><input type ="password" id="asherpassword" /> אשר סיסמא</td>
- </tr>
- <tr>
- <td id = "td6"></td>
- <td><input type = "text" id ="id"/> תעודת זהות</td>
- </tr>
- <tr>
- <td id = "td3"></td>
- <td><input type ="text" id= "pnumber"/> מספר טלפון</td>
- </tr>
- <tr>
- <td id ="td4"></td>
- <td><input type ="text" id="fullname" /> שם מלא </td>
- </tr>
- <tr>
- <td id = "td10"></td>
- <td ><input type ="text" id = "email" />איימיל </td>
- </tr>
- <tr>
- <td id = "td7"></td>
- <td ><input type ="text" id = "adress"/> כתובת </td>
- </tr>
- <tr>
- <td id = "td8"></td>
- <td dir ="rtl"> <input type ="radio" id ="male"/> נקבה <input type = "radio" id = "female" /> זכר</td>
- </tr>
- <tr>
- <td id = "td9"></td>
- <td dir ="rtl"><select id = "day">
- <option>בחר יום</option>
- <option>1</option>
- <option>2</option>
- <option>3</option>
- <option>4</option>
- <option>5</option>
- <option>6</option>
- <option>7</option>
- <option>8</option>
- <option>9</option>
- <option>10</option>
- <option>11</option>
- <option>12</option>
- <option>13</option>
- <option>14</option>
- <option>15</option>
- <option>16</option>
- <option>17</option>
- <option>18</option>
- <option>19</option>
- <option>20</option>
- <option>21</option>
- <option>22</option>
- <option>23</option>
- <option>24</option>
- <option>25</option>
- <option>26</option>
- <option>27</option>
- <option>28</option>
- <option>29</option>
- <option>30</option>
- <option>31</option>
- </select>
- <select id = "month">
- <option>בחר חודש</option>
- <option>1</option>
- <option>2</option>
- <option>3</option>
- <option>4</option>
- <option>5</option>
- <option>6</option>
- <option>7</option>
- <option>8</option>
- <option>9</option>
- <option>10</option>
- <option>11</option>
- <option>12</option>
- </select>
- </td>
- </tr>
- </table>
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <br />
- <input type ="submit" value = "הרשמה" />
- </center>
- </form>
- <script type ="text/javascript">
- function CheckForm() {
- var a = Checkuserandpassword() ;
- var b = CheckPhonenumber();
- var c = CheckFullname();
- var d = CheckID();
- var e = Checkadress();
- var f = CheckGender();
- var g = CheckBorn();
- var h = Check();
- return a, b, c, d, e, f, g, h;
- }
- function Checkuserandpassword() {
- var username = document.getElementById("username").value;
- var password = document.getElementById("password").value;
- var asherpassword = document.getElementById("asherpassword").value;
- var bool1 = false;
- var bool2 = false;
- var bool3 = false;
- var bool4 = false;
- var bool5 = false;
- var bool6 = false;
- var bool7 = false;
- var bool8 = false;
- var bool9 = false;
- if (username !="") // בודק האם כתוב משהו.
- bool1 = true;
- else
- document.getElementById("td1").innerHTML = "לא הוכנס שם משתמש!";
- if (username.length > 7) // בדוק האם האורך מספיק
- bool2 = true;
- else
- document.getElementById("td1").innerHTML = "שם המשתמש לא ארוך מספיק ";
- if (username = password) // האם שם מתשמש וסיסמא זהים
- document.getElementById("td2").innerHTML = "שם מתשמש וסיסמא זהים";
- else
- bool3 = true;
- if (asherpassword == password) { // בודק האם סיסמא ואימות סיסמא זהים
- bool6 = true;
- }
- else {
- document.getElementById("td2").innerHTML = "שגיאה - סיסמא ואימות סיסמא אינם זהים";
- }
- }
- // ----------------------------------------------------------------------------------- מספר טלפון
- function CheckPhonenumber() {
- var phonenumber = document.getElementById("pnumber").value;
- //string str = "blablabla";
- if (phonenumber.substring(1, 2) >= '0' && phonenumber.substring(4, phonenumber.length) <= '9') {
- bool4 = true;
- }
- else {
- document.getElementById("td3").innerHTML = "שגיאה - המספר מכיל תווים לא חוקיים"; // בודק האם המספר רק עם ספרות
- }
- if (phonenumber.charAt(3) != '-') {
- document.getElementById("td3").innerHTML = "שגיאה - המספר אינו מכיל תו מפריד"; // בודק האם המספר מכיל תו מפריד
- }
- if (phonenumber.charAt(0) != '0') {
- document.getElementById("td3").innerHTML = "שגיאה - הספרה הראשונה אינה 0"; // בודק האם הספרה הראשונה היא 0
- }
- }
- // ------------------------------------------------------------------------------------------------- שם פרטי ושם משפחה
- function CheckFullname() {
- var fullname = document.getElementById("fullname").value;
- }
- // ----------------------------------------------------------------------------------------------------------- תעודת זהות
- function CheckID() {
- var ID = document.getElementById("id").value;
- if (ID.Length != 9) {
- document.getElementById("td6").innerHTML = "שגיאה - אורך תעודת זהות אינו תקין";
- }
- if (ID.substring(0,ID.length) >= '0' && ID.substring(0,ID.length) <= '9') {
- bool7 = true;
- }
- else
- document.getElementById("td6").innerhtml = "שגיאה - תעודת הזהות מכילה תווים לא חוקיים";
- }
- // -------------------------------------------------------------------------------------------------------- כתובת
- function Checkadress() {
- var adress = document.getElementById("adress").value;
- if (adress.substring(0, adress.length) >= 'א' && adress.substring(0, adress.length) <= 'ת') { // בודק האם כתובת בעברית
- bool5 = true;
- }
- else
- document.getElementById("td7").innerHTML = "שגיאה - תווים לא חוקיים בכתובת";
- }
- // ----------------------------------------------------------------------------------------------------------------- מין
- function CheckGender() {
- var male = document.getElementById("male");
- var female = document.getElementById("female");
- if (male.checked || male.checked) { // בודק האם נבחר מין
- bool8 = true;
- }
- else {
- document.getElementById("td8").innerHTML = "שגיאה - לא בחרת מין";
- }
- }
- // ------------------------------------------------------------------------------------------------------------------------ תאריך לידה
- function CheckBorn() {
- var day = document.getElementById("day");
- var month = document.getElementById("month");
- if ((day.selectedIndex[0, day.length] != day.selectedIndex[0]) && (month.selectedIndex[0, month.length] != month.selectedIndex[0])) {
- bool9 = true;
- }
- else {
- document.getElementById("td9").innerHTML = "שגיאה - לא בחרת חודש או יום";
- }
- }
- function Check() {
- var counter = 0;
- var counter2 = 0;
- var email = document.getElementById("email").value;
- for (var i = 0; i < email.length; i++) {
- if (email.charAt(i) = "@") {
- counter++;
- }
- }
- if (counter == 0) {
- document.getElementById("td10").innerHTML = "שגיאה חסר שטרודל";
- }
- if (counter > 1) {
- document.getElementById("td10").innerHTML = "שגיאה התו שטרודל מופיע יותר מפעם אחת";
- }
- for (var i = 0; i < email.length; i++) {
- if (email.charAt(i) = ".") {
- counter2++;
- }
- }
- if (counter2 == 0) {
- document.getElementById("td10").innerHTML = "שגיאה חסר נקודה";
- }
- if (counter2 > 1) {
- document.getElementById("td10").innerHTML = "שגיאה התו נקודה מופיע יותר מפעם אחת";
- }
- }
- </script>
- </asp:Content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement