forked from VaishnaviR99/PharmEasy_clone13
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsignup.js
More file actions
42 lines (28 loc) · 956 Bytes
/
signup.js
File metadata and controls
42 lines (28 loc) · 956 Bytes
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
function signup(e) {
event.preventDefault();
var username = document.getElementById('Name').value;
var mobno = document.getElementById('no').value;
var pass = document.getElementById('passw').value;
var cpass = document.getElementById('cpassw').value;
var user = {
mobnumber: mobno,
username: username,
password: pass,
};
var json = JSON.stringify (user);
localStorage.setItem(username, json);
console.log('user added');
if(mobno=="" || pass=="" || username==""){
alert("Fill details...!!!");
}
else if(pass!==cpass){
alert("passwored not match");
}
else if(pass===cpass){
alert("Account created succesfully...!!!");
signuptest();
}
}
function signuptest() {
window.location.href = "login.html";
}