-
Notifications
You must be signed in to change notification settings - Fork 0
/
script3.js
36 lines (33 loc) · 1.09 KB
/
script3.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
36
document.getElementById('btn').onclick = function(){
var name = document.getElementById('name').value;
var password = document.getElementById('password').value;
var email = document.getElementById('email').value;
var valid = true;
if(name == ''){
alert('name field is required')
valid = false;
}
if(name<10){
alert('name is less than 10 characters')
valid = false;
}
if(password == ''){
alert('password is required')
valid = false;
}
if(email == ''){
alert('email is required')
valid = false;
}
if(email.endsWith("@gmail.com")==false){
alert('email is incorrect')
valid = false;
}
if(password.includes('@')==false || password.includes('#' || password.includes('&'))){
alert('use speacial symbols like @ # !')
valid = false;
}
if(valid==true){
window.location.href="2stopwatch.html";
}
}