-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpassword validation.html
More file actions
34 lines (30 loc) · 874 Bytes
/
password validation.html
File metadata and controls
34 lines (30 loc) · 874 Bytes
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
<html>
<head>
<script>
function checkpass() {
var pass1 = document.getElementById('password');
var pass2 = document.getElementById('confirm_password');
var message = document.getElementById('confirmMessage');
var goodcolor = "#66CC66";
var badcolor = "#ff6666";
if (pass1.value == pass2.value) {
message.style.color = goodcolor;
message.innerHTML = "password Match"
}
else {
message.style.color = badcolor;
message.innerHTML = "password do not match!"
}
}
</script>
</head>
<body>
<form>
<input type="text" placeholder="password" id="password" required>
<input type="text" placeholder="confirm password" id="confirm_password" required onKeyUp="checkpass();"
onBlur="validpass()">
<span id="confirmMessage" class="confirmMessage"></span>
<input type="submit" name="save" value="save">
</form>
</body>
</html>