-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
74 lines (63 loc) · 1.91 KB
/
index.html
File metadata and controls
74 lines (63 loc) · 1.91 KB
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
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title>JS Form Validation</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.css" />
<style type="text/css">
label{
width:150px;
display: inline-block;
}
span{width:200px;}
body{
width: 970px;
margin: 50px auto;
}
</style>
</head>
<body>
<form method="POST" action="" onsubmit="return checkForm(this);">
<fieldset>
<legend>User Registration</legend>
<p>
<label for="">Username:</label>
<input title="Enter your username" type="text" required name="username"/>
</p>
<p>
<label for="">Password: </label>
<input type="password" title="Please enter the Password." name="pwd1" onchange=" this.setCustomValidity(this.validity.patternMismatch ? this.title : ''); if(this.checkValidity())form.pwd2.pattern = this.value;" required/>
</p>
<p>
<label for="">Confirm Password:</label>
<input title="Please enter the same Password as above" type="password" required name="pwd2"
onchange="this.setCustomValidity(this.validity.patternMismatch ? this.title : '');">
</p>
<p><input type="submit" value="Submit"></p>
</fieldset>
</form>
<br />
<br />
<br />
<br />
<form action="">
<h3>User Registration</h3>
<span id='message'></span> <br />
<label>password :</label>
<input name="password" id="password" type="password" />
<br>
<label>confirm password:</label>
<input type="password" name="confirm_password" id="confirm_password" />
<br />
<input type="submit" name="" id="" />
</form>
<script src="jquery.min.js"></script>
<script>
$('#confirm_password').on('keyup', function () {
if ($(this).val() == $('#password').val()) {
$('#message').html('<i class="fa fa-check"></i> Password matched!').css({"color": "green"});
} else $('#message').html('<i class="fa fa-close"></i> Password not matching').css({"color": "red"});
});
</script>
</body>
</html>