forked from NikHarshal/updated-project-unit2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
proceed.html
54 lines (45 loc) · 1.58 KB
/
proceed.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
<!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>Document</title>
<link rel="stylesheet" href="payment.css">
</head>
<body>
<div>Payment Gateway</div>
<form action="" id="form">
<label for="">Mobile Number</label><br />
<input type="number" placeholder="Enter Your Number " name="" id="number"/><br/>
<label for="">Payment Method</label><br />
<select name="" id="type">
<option value="Visa">Visa</option>
<option value="Mastercard">Mastercard</option>
<option value="Razorpay">Razorpay</option>
<option value="Instamoja">Instamoja</option>
</select><br/>
<label for="">OTP</label><br />
<input type="text" placeholder="Enter Your OTP" name="" id="otp"/>
<input placeholder="Proceed" type="submit"/>
</body>
</html>
<script>
var arr= JSON.parse(localStorage.getItem("form"));
console.log(arr);
var x = arr[0];
document.getElementById("number").value = x.number;
document.getElementById("type").value = x.method
document.querySelector("#form").addEventListener("submit",make);
function make(){
event.preventDefault();
if(document.querySelector("#otp").value == 1234){
console.log("Payment Successfully ")
alert("Payment Successfully");
window.location.href = "index.html"
}
else {
alert("Invalid value");
}
}
</script>