-
Notifications
You must be signed in to change notification settings - Fork 0
/
sign.js
49 lines (34 loc) · 1.4 KB
/
sign.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
37
38
39
40
41
42
43
44
45
46
47
48
49
let name = document.getElementById('name');
let fatherName = document.getElementById('father');
let email = document.getElementById('email');
let date = document.getElementById('date');
let radio = document.getElementsByName('gender');
let pass = document.getElementById('password');
let btn = document.getElementById('buton');
btn.addEventListener('click',function () {
let i;
if (name.value == '' || fatherName.value == '' || email.value == '' || date.value == '' || pass.value == '') {
alert('Please enter your Detail')
}
else{
console.log(name.value);
console.log(fatherName.value);
console.log(email.value);
console.log(date.value);
console.log(pass.value);
for (i = 0; i < radio.length; i++) {
if (radio[i].checked) {
console.log(radio[i].value);
}
}
}
if (name.value && fatherName.value && email.value && date.value && pass.value) {
localStorage.setItem('name1', name.value)
localStorage.setItem('fname1', fatherName.value)
localStorage.setItem('email1', email.value)
localStorage.setItem('pass1' , pass.value)
// localStorage.setItem('gender1', radio[i].value)
alert('Thanks for Sign-up')
window.location.href="login.html"
}
});