-
Notifications
You must be signed in to change notification settings - Fork 1
/
login_as_admin.js
31 lines (28 loc) · 939 Bytes
/
login_as_admin.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
let form=document.querySelector("form")
let registerArr=[]
let getArr=JSON.parse(localStorage.getItem("sign"))
form.addEventListener("submit",function(){
event.preventDefault()
let registerobj={
name:form.name.value,
email:form.email.value,
address:form.address.value,
phone:form.phone.value,
}
registerArr.push(registerobj)
//console.log(registerArr)
//localStorage.setItem("reg",JSON.stringify(registerArr))
if(name.value=="" || email.value=="" || address.value=="" || phone.value==""){
alert("Fill all Fiels")
}
else{
getArr.map(function(el){
if(el.email==registerobj.email){
alert("successful")
window.location.href="skincare.html"
}else{
alert("Wrong Email ID")
}
})
}
})