-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.js
More file actions
43 lines (33 loc) · 1.22 KB
/
Copy pathsignup.js
File metadata and controls
43 lines (33 loc) · 1.22 KB
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
document.querySelector("#sheet").addEventListener("submit", myEntries);
dataEntry=JSON.parse(localStorage.getItem("info")) || [];
function myEntries(event){
event.preventDefault();
let first=document.querySelector("#first").value;
let last=document.querySelector("#last").value;
let email=document.querySelector("#email2").value;
let password=document.querySelector("#password2").value;
let number=document.querySelector("#number").value;
let month=document.querySelector("#month").value;
let day=document.querySelector("#day").value;
let pin=document.querySelector("#pin").value;
let objEntry={
first:first,
last:last,
email:email,
password:password,
number:number,
month:month,
day:day,
pin:pin,
}
if(objEntry.first=="" || objEntry.last=="" || objEntry.email=="" || objEntry.password=="" || objEntry.month=="" || objEntry.day=="" || objEntry.pin==""){
alert("Fill all Necessary Fields")
return;
}
else{
dataEntry.push(objEntry);
localStorage.setItem("info",JSON.stringify(dataEntry));
alert("Great! Signup Acomplished");
window.location.href="index.html";
}
}