-
Notifications
You must be signed in to change notification settings - Fork 0
/
reservation.html
113 lines (111 loc) · 3.73 KB
/
reservation.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Reservation Form
</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="stylesheet_reservation.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function() {
// When the form is submitted
$('#reservation-form').on('submit', function(e) {
e.preventDefault(); // Prevent default form submission behavior
// Get the form data
const formData = $(this).serialize();
// Send a POST request to the /reserve endpoint
$.ajax({
type: 'POST',
url: '/reserve',
data: formData,
success: function(response) {
// Handle successful response
console.log(response);
},
error: function(xhr, status, error) {
// Handle error response
console.log(xhr.responseText);
}
});
});
});
</script>
</head>
<body>
<!--navigation bar-->
<section class="header">
<!-- Fix name fragment -->
<a href="#name" class="logo">Daily Brew
</a>
<nav>
<ul>
<li>
<a href="index.html" >Home
</a>
</li>
<li>
<a href="menu.html" >Menu
</a>
</li>
<li>
<a href="index.html#about">About Us
</a>
</li>
<li>
<a href="index.html#contact">Contact Us
</a>
</li>
<li>
<a href="reservation.html" class="button">Book Reservation
</a>
</li>
<li><a href="checkout.html" class="button">Check Out</a></li>
</ul>
</nav>
</section>
<!--background image-->
<div class="bg-image">
</div>
<!--reservation-->
<div class="reservation">
<div class="container">
<div class="form-data">
<h2>Book Reservation
</h2>
<form id="reservation-form" action="#">
<label>
<input type="text" name="name" placeholder="Name">
</label>
<label>
<input type="text" name="phone" placeholder="Phone Number">
</label>
<label>
<input type="email" name="email" placeholder="Email Address">
</label>
<label>
<input type="date" name="date" placeholder="Date">
</label>
<label>
<input type="number" name="tableSize" placeholder="Table Size" min="1">
</label>
<label>
<select name="time" class="hours">
<option value="hour-select">Select Time</option>
<option value="10">8:00am</option>
<option value="10">9:00am</option>
<option value="10">10:00am</option>
<option value="10">12:00pm</option>
<option value="10">2:00pm</option>
<option value="10">3:00pm</option>
<option value="10">4:00pm</option>
</select>
</label>
<button type="submit">Book Reservation</button>
</form>
</div>
</div>
</div>
</body>
</html>