-
Notifications
You must be signed in to change notification settings - Fork 1
/
address.html
131 lines (111 loc) · 3.7 KB
/
address.html
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Address</title>
<style>
#address {
display: flex;
width: 80%;
align-items: center;
justify-content: center;
/* border: 1px solid red; */
}
#left p {
margin-top: -3%;
}
#address>#left {
margin-top: -1%;
/* border: 1px solid red*/
}
#address>#right {
margin-top: 1%;
margin-left: 10%;
/* border: 1px solid red; */
}
#address input {
display: flex;
flex-direction: column;
margin-bottom: 6%;
}
#address select {
display: flex;
flex-direction: column;
margin-bottom: 6%;
}
#Done {
background-color: orange;
display: block;
margin: auto;
}
</style>
</head>
<body>
<div id="address">
<div id="left">
<p>First Name</p>
<p>Last name</p>
<p>Email</p>
<p>Contact number</p>
<p>Address</p>
<p>Landmark</p>
<p>State</p>
<p>ZipCode</p>
<p>Country</p>
</div>
<div id="right">
<form>
<input id="Fname" type="text" placeholder="Enter First name" />
<input id="Lname" type="text" placeholder="Enter last name" />
<input id="mail" type="text" placeholder="[email protected]" />
<input id="mobile" type="number" placeholder="Enter mobile number" />
<input id="add" type="text" placeholder="Addresss line" />
<input id="land" type="text" placeholder="Landmark" />
<select name="" id="state">
<option value="Maharashtra">Maharashtra</option>
<option value="Delhi"></option>
<option value="U.P."></option>
</select>
<input id="code" type="number" placeholder="ZipCode" />
<select name="" id="country">
<option value="India">India</option>
</select>
<input id="Done" type="submit" value="DONE" />
</form>
</div>
</div>
</body>
</html>
<script>
document.querySelector("form").addEventListener("submit", formSubmit);
var userStack = JSON.parse(localStorage.getItem("UserAdd")) || [];
function formSubmit(event) {
event.preventDefault();
var Fname = document.getElementById("Fname").value;
var Lname = document.getElementById("Lname").value;
var mail = document.getElementById("mail").value;
var mobile = document.getElementById("mobile").value;
var add = document.getElementById("add").value;
var land = document.getElementById("land").value;
var state = document.getElementById("state").value;
var code = document.getElementById("code").value;
var country = document.getElementById("country").value;
var userData = {
name1: Fname,
name2: Lname,
mail1: mail,
mobile1: mobile,
add1: add,
land1: land,
state1: state,
code1: code,
country1: country,
};
userStack.push(userData);
localStorage.setItem("UserAdd", JSON.stringify(userStack));
alert("Submitted Successfully");
window.location.href = "delivery.html";
}
</script>