forked from heyvipul/blueFly
-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_Account.js
28 lines (25 loc) · 961 Bytes
/
create_Account.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
var login_details=JSON.parse(localStorage.getItem("login-details")) || [];
document.querySelector("form").addEventListener("submit",function(){
event.preventDefault();
var Fname=document.getElementById("f_name").value;
var Lname=document.getElementById("l_name").value;
var email=document.getElementById("mail").value;
var password=document.getElementById("password").value;
if(Fname=="" || Lname=="" || email=="" || password==""){
alert("Fill all the details");
}
else{
var obj={};
obj["f_name"]=Fname;
obj["l_name"]=Lname;
obj["email"]=email;
obj["password"]=password;
login_details.push(obj);
var objj={};
objj["f_name"]=Fname;
objj["l_name"]=Lname;
localStorage.setItem("current_details",JSON.stringify(objj));
localStorage.setItem("login-details",JSON.stringify(login_details));
window.location.href="details.html";
}
});