SignUp.html 1.38 KB
Newer Older
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
<!DOCTYPE html>
<html>
<body>

<h2>Sign up Form</h2>

<form action="/" method="post">
  <div class ="signUpContainer">
  <label for="email"><b>Email:<br></b></label>
  <input type="email" placeholder="Enter Email" name="email"  onkeyup='validateEmail(email);' required/><br>
 
   <label>password : <br>
  <input name="password" placeholder="Enter Password" id="password" type="password" onkeyup='check();' required />
</label>`
<br>
<label>confirm password: <br>
  <input type="password" placeholder="Re-enter Password" name="confirm_password" id="confirm_password"  onkeyup='check();' required/> 
  <span id='message'></span>
</label>`<br>
      <input type="submit" value = "Submit" ></input>
    <script> 
      var check = function() {
  if (document.getElementById('password').value ==
    document.getElementById('confirm_password').value) {
    document.getElementById('message').style.color = 'green';
    document.getElementById('message').innerHTML = 'matching';
  } else {
    document.getElementById('message').style.color = 'red';
    document.getElementById('message').innerHTML = 'not matching';
  }
}
function validateEmail() {
    var re = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/;
    return re.test(String(email).toLowerCase());
}
</script>
      
    </div>
</form>

</body>
</html>