-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAddressPage.html
81 lines (68 loc) · 2.61 KB
/
AddressPage.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
<!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_Page</title>
<link rel="stylesheet" href="AddresspageCSS.css">
<link href="images"></link>
</head>
<style>
</style>
<body>
<div id="addnav"><img src="AddressNav.PNG" alt=""></div>
<form action="" id="form">
<div id="main">
<div id="AddressDetail">
<h2>Edit Address</h2>
<label for="">Select Country</label>
</div>
<input type="text" class="form__field" placeholder="India" id="country">
<div class="form__group field">
<input type="input" class="form__field" placeholder="Name" name="name" id="name" required />
<label for="name" class="form__label">Name</label>
</div>
<div class="form__group field">
<input type="name" class="form__field" placeholder="+91" id="Num" required/>
<label for="" class="form__label">Phone Number</label>
</div>
<div class="form__group field">
<input type="name" class="form__field" placeholder="Postal Code" id="code" required/>
<label for="" class="form__label">Postal Code</label>
</div>
<div>
<fieldset>
<legend>Address</legend>
<textarea id="multi" name="nam" rows="4" cols="20"></textarea>
</fieldset>
</div>
<div id="check">
<input type="checkbox" id="chek" name="" value="name">
<label for="">Use this as my default Shipping Address</label>
</div>
<div>
<input id="submit" type="submit" name="submit" value="ship to this Address >" />
</div>
</div>
</form>
<div id="imgfoot"><img src="images/Addressfooter.PNG" alt=""></div>
</body>
</html>
<script>
document.querySelector("form").addEventListener("submit",myAddress)
let AddArr=JSON.parse(localStorage.getItem("AddData"))||[];
function myAddress(){
event.preventDefault();
let AddressObj={
country:document.querySelector("#country").value,
Name:document.querySelector("#name").value,
phone:document.querySelector("#Num").value,
code:document.querySelector("#code").value,
Addresss:document.querySelector("#multi").value,
}
AddArr.push(AddressObj);
localStorage.setItem("AddData",JSON.stringify(AddArr))
window.location.href="payment.html"
}
</script>