-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaddress.html
44 lines (41 loc) · 1.65 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
<!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>payment</title>
<link rel="stylesheet" href="./style.css">
</head>
<body>
<section class="payment-section">
<div class="payment-form">
<form id="pay-form">
<h1>Address</h1>
<input type="text" placeholder="address line-1" id="addressText" required />
<input type="text" id="state" placeholder="state"
style="border-right: none; border-radius: 4px 0 0 4px;" required />
<input type="text" id="district" placeholder="district" style="border-radius: 0 4px 4px 0;" required />
<input type="number" id="pin_code" placeholder="PIN Code xxxx" required />
<input type="number" id="phone" placeholder="+91 xxxxxxxxxx" required />
<button type="submit" id="pay">CONTINUE</button>
</form>
</div>
</section>
<script>
const form = document.getElementById("pay-form");
form.addEventListener("submit", (event) => {
event.preventDefault();
const addressApi = {
address: form.addressText.value,
state: form.state.value,
district: form.district.value,
pinCode: form.pin_code.value,
phone: form.phone.value
}
localStorage.setItem("addressInfo", JSON.stringify(addressApi));
location.href = "./payment.html"
})
</script>
</body>
</html>