-
Notifications
You must be signed in to change notification settings - Fork 1
/
signup_page_udit.js
54 lines (31 loc) · 997 Bytes
/
signup_page_udit.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
50
51
52
53
54
var signupDataArr = JSON.parse(localStorage.getItem("Database")) || [] ;
document.querySelector("#form").addEventListener("submit", function(event){
event.preventDefault();
var email = document.querySelector("#email").value;
var mobile = document.querySelector("#mobile").value;
var password = document.querySelector("#password").value;
var name = document.querySelector("#name").value;
var signupDataObj = {
name: name,
mail: email,
phone:mobile,
passcode: password
}
const correct_Data = () =>{
for(let key in signupDataObj){
if(signupDataObj[key] == ""){
return false;
break;
}
}
}
if(correct_Data() == false){
alert("Please fill All the Datails")
}
else{
alert("Sing-up Successful")
signupDataArr.push(signupDataObj);
localStorage.setItem("Database",JSON.stringify(signupDataArr));
window.location.href = "index.html"
}
})