-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathpayment.html
116 lines (90 loc) · 4.07 KB
/
payment.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
104
105
106
107
108
109
110
111
112
113
114
115
116
<!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">
<!-- FAVICON -->
<link rel="icon" type="image/png" href="images/download.png">
<!-- custom css file link -->
<link rel="stylesheet" href="css/payment.css">
</head>
<body>
<div class="container">
<form id="checkout-form" action="payment.php" method="POST">
<div class="row">
<div class="col">
<h3 class="title">Billing address</h3>
<div class="inputBox">
<span>email :</span>
<input type="email" id="email" placeholder="Enter Your Mail Here.." name="email" required>
</div>
<div class="inputBox">
<span>address :</span>
<input type="text" id="address" placeholder="Enter Your Address" name="address" required>
</div>
<div class="inputBox">
<span>district :</span>
<input type="text" id="city" placeholder="Enter Your District" name="district" required>
</div>
<div class="flex">
<div class="inputBox">
<span>state :</span>
<input type="text" id="state" placeholder="Enter Your State" name="state" required>
</div>
<div class="inputBox">
<span>pin code :</span>
<input type="text" id="pincode" placeholder="Enter Pin Code" name="pincode" data-mask="000 000" required>
</div>
</div>
</div>
<div class="col">
<h3 class="title">payment</h3>
<div class="inputBox">
<span>cards accepted :</span>
<img src="images/card_img.png" alt="">
</div>
<div class="inputBox">
<span>Card Holder's Name :</span>
<input type="text" id="cardholder" placeholder="Enter your name" name="cname" required>
</div>
<div class="inputBox">
<span>credit card number :</span>
<input type="text" id="cardnumber" placeholder="Enter Card Number" name="cnum" data-mask="0000 0000 0000 0000" required>
</div>
<div class="flex">
<div class="inputBox">
<span>exp year :</span>
<input type="text" id="expyear" data-mask="00 / 00" name="expiry" placeholder="00 / 00" required>
</div>
<div class="inputBox">
<span>CVV :</span>
<input type="text" id="cvv" data-mask="000" placeholder="000" name="cvv" required>
</div>
</div>
</div>
</div>
<input type="submit" value="Proceed to checkout" class="submit-btn2" href="invoice.html">
<a href="cart-page.html" class="return-home-btn">Return Home</a>
</form>
</div>
<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.min.js"></script>
<script>
// Add a submit event listener to the form
document.getElementById("checkout-form").addEventListener("submit", function (event) {
const requiredFields = this.querySelectorAll("[required]");
let isValid = true;
requiredFields.forEach(function (field) {
if (field.value.trim() === "") {
isValid = false;
}
});
if (!isValid) {
event.preventDefault(); // Prevent form submission
alert("Please fill out all required fields.");
}
});
</script>
</body>
</html>