-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalid.js
More file actions
38 lines (34 loc) · 968 Bytes
/
Copy pathvalid.js
File metadata and controls
38 lines (34 loc) · 968 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
35
36
37
38
var email= document.forms['form']['email'];
var password= document.forms['form']['password'];
var email_error = document.getElementById('email_error');
var pass_error = document.getElementById('pass_error');
email.addEventListner('textInput',email_Verify);
password.addEventListner('textInput',pass_Verify);
function validated(){
if(email.value.length < 9){
email.style.border="1px solid red";
email_error.style.display="block";
email.focus();
return false;
}
if(password.value.length < 6){
password.style.border="1px solid red";
pass_error.style.display="block";
password.focus();
return false;
}
}
function email_Verify(){
if(email.value.length >=8){
email.style.border="1px solid silver";
email_error.style.display="none";
return true;
}
}
function pass_Verify(){
if(password.value.length >=5){
password.style.border="1px solid silver";
pass_error.style.display="none";
return true;
}
}