-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathotp.html
86 lines (80 loc) · 1.93 KB
/
otp.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
<!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>
<style>
h1 {
text-align: center;
}
#paymentParent {
padding: 10px;
justify-content: center;
align-items: center;
width: 30%;
margin: auto;
padding-left: 25px;
margin-top: 120px;
box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
border-radius: 20px;
}
form {
font-size: 18px;
align-items: center;
}
input {
padding: 10px;
margin-bottom: 20px;
margin-top: 20px;
width: 87%;
border-radius: 7px;
}
input[type="month"] {
width: 87%;
}
input[type="submit"] {
width: 97%;
background-color: green;
color: white;
border-radius: 10px;
border: none;
}
#Pay:hover {
transform: scale(1.055);
}
</style>
</head>
<body>
<h1>Payment Page</h1>
<div id="paymentParent">
<form action="">
<label for="number">Enter your Otp:</label> <br />
<input
type="text"
name=""
id="otp"
placeholder="Enter Your 4 digit Otp"
/><br />
<input type="submit" id="Pay" value="Submit" />
</form>
</div>
</body>
</html>
<script>
document.querySelector("form").addEventListener("submit", done);
function done() {
event.preventDefault();
var number = document.getElementById("otp").value;
if (number.length == 4) {
alert("Payment Done");
var arr = [];
localStorage.setItem("items", JSON.stringify(arr));
localStorage.setItem("totalvalue", 0);
window.location.href = "index.html";
} else {
alert("Wrong Otp");
}
}
</script>