-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbooking.html
210 lines (188 loc) · 7.63 KB
/
booking.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
<html>
<head>
<title>Booking Page</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.6.0/css/all.min.css">
<link rel="stylesheet" href="bookingcss.css">
<style>
html {
scroll-behavior: smooth; /* Enable smooth scrolling */
}
</style>
</head>
<body>
<header class="header">
<nav class="navbar">
<a href="index.html">Home</a>
<a href="menu.html">Menu</a>
<a href="destinations.html">Destination</a>
<a href="about.html">About Us</a>
</nav>
<a href="#book-form" class="btn">Book Now</a>
</header>
<section class="home" id="home">
<div class="content">
<span>Follow us</span>
<h3>to the unknown</h3>
<p>let's unveil the hidden wonders of India and create stories that last a lifetime</p>
<a href="#book-form" class="btn">Book Now</a>
</div>
</section>
<br><br><br><br><br><br><br><br><br><br><br><br>
<section class="book-form" id="book-form">
<form action="" method="post">
<div class="inputBox">
<span>Destination</span>
<select id="destination" required>
<option value="" disabled selected>Select a destination</option>
<option value="delhi">Delhi</option>
<option value="haryana">Haryana</option>
<option value="rajasthan">Rajasthan</option>
<option value="punjab">Punjab</option>
<option value="maharashtra">Maharashtra</option>
<option value="gujarat">Gujarat</option>
<option value="goa">Goa</option>
<option value="madhya-pradesh">Madhya Pradesh</option>
<option value="chhattisgarh">Chhattisgarh</option>
<option value="bihar">Bihar</option>
<option value="west-bengal">West Bengal</option>
<option value="andhra-pradesh">Andhra Pradesh</option>
<option value="jharkhand">Jharkhand</option>
<option value="arunachal-pradesh">Arunachal Pradesh</option>
<option value="assam">Assam</option>
<option value="manipur">Manipur</option>
<option value="mizoram">Mizoram</option>
<option value="sikkim">Sikkim</option>
<option value="tripura">Tripura</option>
<option value="nagaland">Nagaland</option>
<option value="karnataka">Karnataka</option>
<option value="kerala">Kerala</option>
<option value="telangana">Telangana</option>
<option value="meghalaya">Meghalaya</option>
<option value="odisha">Odisha</option>
</select>
</div>
<div class="inputBox">
<span>Check in</span>
<input type="date" id="checkin" required>
</div>
<div class="inputBox">
<span>Check out</span>
<input type="date" id="checkout" required>
</div>
<div class="inputBox">
<span>Number of Guests</span>
<input type="number" id="guests" min="1" max="10" required>
</div>
<div class="inputBox">
<span>Name</span>
<input type="text" id="name" name="name" required>
</div>
<div class="inputBox">
<span>Email</span>
<input type="email" id="email" name="email" required>
</div>
<div class="inputBox">
<span>Contact</span>
<input type="text" id="contact" name="contact" required>
</div>
<div class="inputBox">
<span>Credit Card Number</span>
<input type="text" id="creditCard" name="creditCard" required>
</div>
<div class="inputBox">
<span>Expiry Date</span>
<input type="date" id="expiry" required>
</div>
<input type="submit" value="Find now" class="btn">
</form>
</section>
<footer>
<div class="footer-content">
<div class="contact-info">
<h3>Contact Us</h3>
<p>Email: <a href="mailto:queries@bharat.com">queries@bharat.com</a></p>
<p>Phone: 9424345464 / 8978675645</p>
<p>Address: <a href="https://maps.app.goo.gl/vQRjdmF71XuuWKen7">GB Road, Chameli Chowk, Raju Nagar, New Delhi, India</a></p>
</div>
<div class="quick-links">
<h3>Quick Links</h3>
<a href="index.html">Home</a>
<a href="menu.html">Menu</a>
<a href="contact.html">Contact</a>
<a href="about.html">About Us</a>
</div>
<div class="social-media">
<h3>Follow Us</h3>
<a href="https://facebook.com" target="_blank">Facebook</a>
<a href="https://twitter.com" target="_blank">Twitter</a>
<a href="https://instagram.com" target="_blank">Instagram</a>
<a href="https://linkedin.com" target="_blank">LinkedIn</a>
</div>
</div>
<div class="footer-bottom">
<p>© 2024 BHARAT: The Jewels of India. All rights reserved.</p>
</div>
</footer>
<script>
document.addEventListener("DOMContentLoaded", function() {
const form = document.querySelector("form");
form.addEventListener("submit", function(event) {
event.preventDefault(); // Prevent form submission initially
const destination = document.getElementById("destination").value;
const checkin = document.getElementById("checkin").value;
const checkout = document.getElementById("checkout").value;
const guests = document.getElementById("guests").value;
const email = document.getElementById("email").value;
const creditCard = document.getElementById("creditCard").value;
const expiry = document.getElementById("expiry").value;
// Validation
if (!destination) {
alert("Please select a destination.");
return;
}
if (!checkin) {
alert("Please select a check-in date.");
return;
}
if (!checkout) {
alert("Please select a check-out date.");
return;
}
if (new Date(checkin) >= new Date(checkout)) {
alert("Check-out date must be after check-in date.");
return;
}
if (!guests || guests < 1 || guests > 10) {
alert("Please enter a valid number of guests (1-10).");
return;
}
// Email validation
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailPattern.test(email)) {
alert("Please enter a valid email address.");
return;
}
// Credit card validation
function isValidCreditCardNumber(value) {
const regex = /^\d{16}$/; // 16 digits
return regex.test(value);
}
if (!isValidCreditCardNumber(creditCard)) {
alert("Please enter a valid credit card number (16 digits).");
return;
}
// Expiry date validation
const expiryDate = new Date(expiry);
const currentDate = new Date();
if (expiryDate < currentDate) {
alert("The expiry date must be in the future.");
return;
}
// If all validations pass, show success message and submit the form
alert("Form submitted successfully!"); // Placeholder for actual submission
form.submit(); // Submits the form
});
});
</script>
</body>
</html>