-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpaymentStatus.html
56 lines (43 loc) · 1.36 KB
/
paymentStatus.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
<!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 Status</title>
<link rel="stylesheet" href="login.css">
</head>
<body>
<div class="main">
<form>
<h2>Enter OTP </h2>
<p>Use '1234' as otp for payment success</p>
<input type="text" name="" id="user" class="otp" placeholder="Enter OPT You Received"><br><br>
<input type="submit" id="sub" value="Submit">
</form>
</div>
<!-- <h2>Enter OTP</h2>
<h4>Use 1234 as OTP</h4>
<form action="">
<input type="text" id="otp" size="1" minlength="4" maxlength="4"><br><br>
<input type="submit" id="conf" value="Confirm"> -->
</form>
</body>
</html>
<script>
document.querySelector("form").addEventListener("submit", payment);
function payment(event) {
event.preventDefault();
var otpValue=document.querySelector(".otp").value;
if(otpValue==1234){
alert("Payment Success, Redirect to Home Page");
window.location.href ="homepage.html";
localStorage.setItem("cartItems",null)
}
else{
document.querySelector(".otp").value=null;
alert("Wrong OTP, Re-enter OTP again");
}
}
</script>
</script>