signup.html 3.98 KB
Newer Older
Ajayguru Madu's avatar
Ajayguru Madu committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<html>
 <head>
        <link rel="stylesheet" href="style.css">
        <link rel="stylesheet" href="list.css">
        <title>Signup</title>
    <link rel="stylesheet" href="login_style.css" media="all" /> 
            </head>
    <body>
            <div class="topnav">
                    <ul>
                        <li ><a href='index.php'>Home</a></li>
                        <li ><a href='signup.html'>Want To Be a Blood Donar</a></li>
                        <li ><a href='aboutus.html'>About Us</a></li>
                        <li ><a href='contact.html'>Contact</a></li>
                      
                        
                      
                    </ul>
                </div>
      <div class="login">
            <h2 style="color:white; text-align:center;"></h2>
            <h2 style="color:white; text-align:center;"></h2>
                <h2 style="color: white">Fill Your Details</h2>
                <form method="post" name="myform"action="http://localhost/blood/insert.php" onsubmit="return validateform()">
                       <input type="text" id="nam"name="uname" placeholder="Username" required="required" />
                       <p style="color: white"><b>Your Blood Group:</b></p> <select name="blood" id="blood"style="color: red" required="required">
                            <option value="A+">A+</option>
                            <option value="A-">A-</option>
                            <option value="B+">B+</option>
                            <option value="B-">B-</option>
                            <option value="AB+">AB+</option>
                            <option value="AB-">AB-</option>
                            <option value="O+">O+</option>
                            <option value="O-">O-</option>
                          </select>
                          <br>
                          <br>
                   <input type="text" id="numb" name="age" placeholder="Age" required="required" />
                   <input type="text" id="add1"name="addr1" placeholder="Address Line 1" required="required" />
                   <input type="text" id="mb"name="mobile" placeholder="Mobile Number" required="required" />
                <input type="text" id="city"name="city" placeholder="City" required="required" />
                    <button type="submit" class="btn btn-primary btn-block btn-large" name="signup">Submit</button>
                </form>
            </div>
    </body>
    <script>
            function validateform() {
              var x, text,blod,ad1,mb,cit,nam;
              // Get the value of the input field with id="numb"
              x = document.myform.age.value;
              nam = document.myform.uname.value;
              ad1 = document.myform.addr1.value;
              mb = document.myform.mobile.value;
              cit = document.myform.city.value;
              if(nam.length<5)
              {
                  alert("Your name should contain more than 4 Letters!!");
                  return false;
              }
              
              else if (x >66 || x < 16 || isNaN(x)) {
                alert("Sorry You cannot donate blood age should be 16 to 66");
                return false;
              }
              else if(ad1.length<6)
              {
                  alert("Your Address Line 1 should contain more than 5 Letters!!");
                  return false;
              }
              else if(mb.length<10 || mb.length>10||isNaN(x))
              {
                  alert("Your Mobile number should have 10 digits!!");
                  return false;
              }
               else if(cit.length<3)
              {
                  alert("Your Cityname should contain more than 3 Letters!!");
                  return false;
              }

              
              else
              {
                  alert("Details Recorded Successfully");
                  return true;
                  
              }
            
              
            
              
            }
            </script>
    <html>