-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathotp.html
103 lines (94 loc) · 2.34 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
<!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>OTP Verification</title>
<link
rel="shortcut icon"
href="https://avatars.githubusercontent.com/u/34937151?s=280&v=4"
type="image/x-icon"
/>
<link rel="stylesheet" href="./style/index.css" />
<link rel="stylesheet" href="./css/common.css" />
</head>
<style>
#payment {
height: auto;
width: 20%;
border: 1px solid rgb(207, 200, 200);
margin: auto;
margin-top: 180px;
box-sizing: border-box;
padding: 25px;
border-radius: 4px;
}
#payment > h2 {
margin: 0;
text-align: center;
font-weight: 500;
}
#options {
display: flex;
flex-direction: column;
columns: 200px;
}
#options > p {
text-align: left;
margin: 0;
margin-top: 10px;
margin-left: 3px;
margin-bottom: 10px;
color: rgb(0, 36, 104);
text-align: center;
}
#options > p:nth-child(2) {
color: black;
margin: 0;
}
#otp {
margin-top: 10px;
margin-bottom: 25px;
height: 35px;
border: 1px solid black;
border-radius: 4px;
padding-left: 10px;
}
#placeOrder {
margin-top: 0px;
height: 35px;
margin-bottom: 17px;
background-color: #f5d891;
border: 1px solid black;
border-radius: 4px;
}
</style>
<body>
<!-- <div id="container"> -->
<div id="payment">
<h2>OTP Verificaion</h2>
<hr />
<form action="" id="options">
<p>An OTP has been sent to ********45</p>
<p>Do not leave the page</p>
<input type="number" id="otp" placeholder="Enter OTP" />
<input type="submit" name="Pay" id="placeOrder" />
</form>
</div>
</body>
</html>
<script>
document.querySelector("#options").addEventListener("submit", getOTP);
function getOTP() {
event.preventDefault();
let otp = document.querySelector("#otp").value;
if (otp == "1234") {
alert("Payment Successful,Your order is placed !");
document.querySelector("#otp").value = "";
window.location.href = "index.html";
} else {
alert("Invalid OTP");
}
}
</script>