Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Register.aspx.cs" Inherits="Register" Title="Nadav's Suissa Registration Page" %>
- <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
- <script type="text/javascript" >
- function FirstNameIsValid() {
- st = document.getElementById("fname").value;
- var ok=true;
- if (Number(st))
- {
- alert("You must enter a valid First Name(not numbers only letters!)");
- document.getElementById("fname").focus();
- ok=false;
- }
- if (st == "") {
- alert("You must enter a First Name");
- document.getElementById("fname").focus();
- ok=false;
- }
- return ok;
- }
- function LastNameIsValid() {
- st = document.getElementById("lname").value;
- var ok=true;
- if (Number(st))
- {
- alert("You must enter a valid Last Name(not numbers only letters!)");
- document.getElementById("fname").focus();
- ok=false;
- }
- if (st == "") {
- alert("You must enter a last name");
- document.getElementById("lname").focus();
- ok=false;
- }
- return ok;
- }
- function AgeIsValid() {
- st = document.getElementById("yearBorn").value;
- var ok=true;
- if (st == "") {
- alert("You must enter an age(year)");
- document.getElementById("yearBorn").focus();
- ok=false;
- }
- if (isNaN(st)) {
- alert("Error, you must enter an apropriate age (year)");
- document.getElementById("yearBorn").focus();
- ok=false;
- }
- else {
- if (Number(st) < 1930 || Number(st) > 2012) {
- alert("Enter an valid year");
- document.getElementById("yearBorn").focus();
- ok=false;
- }
- }
- return ok;
- }
- function PhoneIsValid() {
- var st = document.getElementById("Select1").options.value + "-" + document.getElementById("tel").value;
- var st2 = document.getElementById("tel").value;
- var ok=true;
- if (isNaN(st2)) {
- alert("Error: you must enter numbers only in phone!!");
- document.getElementById("tel").focus();
- ok=false;
- }
- if (st2.length != 7) {
- alert("You must enter a 7 digit number phone number");
- document.getElementById("tel").focus();
- ok=false;
- }
- if (st2 == "") {
- alert("You must enter a phone number");
- document.getElementById("tel").focus();
- ok=true;
- }
- return ok;
- }
- function EmailIsValid() {
- var stEmail = document.getElementById("email").value;
- var ok=true;
- if (stEmail == "") {
- alert("You must enter an email");
- document.getElementById("email").focus();
- ok=true;
- }
- else {
- if (stEmail.indexOf("@") < 0) {
- alert("Email must have @");
- document.getElementById("email").focus();
- ok=false;
- }
- if (stEmail.indexOf(".") < 0) {
- alert("Email must have (.)");
- document.getElementById("email").focus();
- }
- }
- return ok;
- }
- function isvalid()
- {
- if ( FirstNameIsValid() && LastNameIsValid() && PhoneIsValid() && EmailIsValid() && AgeIsValid();
- return true;
- return false;
- }
- function submitForm()
- {
- if (isvalid())
- form1.submit();
- }
- </script>
- <form name="form1" id="form1" action="Register.aspx" method="post" onsubmit="submitForm()">
- <h1>דף הרשמה\Registration Page</h1>
- <center style="color: #000000">
- <table style="width: 40%;" border="1">
- <tr>
- <td style="color: #0000FF">
- שם פרטי:
- </td>
- <td>
- <center><input id="fname" name="fname" style="color: #0000FF" /></center><span
- style="color: #0000FF">
- </span>
- </td>
- </tr>
- <tr>
- <td style="color: #0000FF">
- שם משפחה:
- </td>
- <td>
- <center> <input id="lname" name="lname" style="color: #0000FF" /></center><span
- style="color: #0000FF">
- </span>
- </td>
- </tr>
- <tr>
- <td style="color: #0000FF">
- טלפון:
- </td>
- <td>
- <center><input id="tel" name="tel" dir="ltr" style="color: #0000FF"/><span
- style="color: #0000FF"> -
- </span>
- <select id="Select1" name="Select1" style="color: #0000FF" >
- <option value="02" >02</option>
- <option value="03">03</option>
- <option value="05">05</option>
- <option value="08">08</option>
- <option value="09" selected="selected">09</option>
- <option value="077">077</option>
- </select></center>
- <center></center><span style="color: #0000FF"> </span>
- </td>
- <!--
- <td>
- ******************
- </td>
- -->
- </tr>
- <tr>
- <td style="color: #0000FF">
- אימייל
- </td>
- <td>
- <center><input id="email" name="email" style="color: #0000FF" /></center><span
- style="color: #0000FF">
- </span>
- </td>
- </tr>
- <tr>
- <td style="color: #0000FF; height: 13px;">
- שנת לידה
- </td>
- <td style="height: 13px">
- <center><input id="yearBorn" name="yearBorn" style="color: #0000FF" /></center><span
- style="color: #0000FF">
- </span>
- </td>
- </tr>
- <tr>
- <td style="color: #0000FF">
- שם משתמש</td>
- <td>
- <center><input id="username" name="username" style="color: #0000FF" /></center><span
- style="color: #0000FF">
- </span>
- </td>
- </tr>
- <tr>
- <td style="color: #0000FF">
- סיסמא
- </td>
- <td>
- <center><input id="password" name="password" type="password" style="color: #0000FF" /></center><span
- style="color: #0000FF"> </span>
- </td>
- </tr>
- </table>
- <select id="gender" name="gender">
- <option value="male">זכר</option>
- <option value="female">נקבה</option>
- </select>
- </center>
- <br />
- <input id="Reset1" type="reset" value="נקה" /> <input id="Submit1" type="submit" value="שלח" />
- </form>
- </asp:Content>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement