-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalid.js
35 lines (31 loc) · 928 Bytes
/
valid.js
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
// JavaScript source code
var email = document.forms['form']['email'];
var password = document.forms['form']['password'];
email.addEventListener('textinput', email_Verify);
password.addEventListener('textinput', pass_Verify);
function validated() {
if (email.value.length < 9) {
email.style.border = "1px solis red";
email_error.style.display = "block";
email.focus();
return false;
}
if (password.value.length < 9) {
email.style.border = "1px solis red";
password_error.style.display = "block";
password.focus();
return false;
}
}
function email_Verify() {
if (email.value.length >= 8) {
email.style.border = "1px solid silver";
return true;
}
}
function pass_Verify() {
if (password.value.length >= 8) {
pass.style.border = "1px solid silver";
return true;
}
}