-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbooking.html
More file actions
89 lines (78 loc) · 3.36 KB
/
booking.html
File metadata and controls
89 lines (78 loc) · 3.36 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Booking</title>
<link rel="stylesheet" href="css/style.css">
<link rel="icon" href="images/favicon.ico" type="image/x-icon">
<script src="https://kit.fontawesome.com/ef4bc5fe16.js" crossorigin="anonymous"></script>
</head>
<body id="Global_Body">
<script src="js/navbar.js"></script>
<script src="js/footer.js"></script>
<main class="booking-container">
<div class="details">
<form>
<input type="text" placeholder="Navn" id="name" ><br>
<input type="date" placeholder="Dato" id="date">
<input type="number" placeholder="Antall" id="number"><br>
<input type="email" placeholder="E-mail" id="email"><br>
</form>
<button onclick="openconfirmation()">Bestill Bord</button>
</div>
<div class="confirmation" id="conf">
<div id="textconf"></div>
<button id="closebutton" onclick="closeconfirmation()">Lukk</button>
</div>
<script>
function openconfirmation() {
let name = document.getElementById("name").value
let email = document.getElementById("email").value
let date = document.getElementById("date").value
let number = document.getElementById("number").value
if (name != "" && email != "" && date != "" && number != "") {
let time = (Math.floor(Math.random() * 12) + 12) + ":30"
document.getElementById("conf").style.display = "block"
document.getElementById("textconf").innerHTML = "Takk " + name + " du har fått bord for " + number + " folk på " + date + " kl " + time
}
// Vet ikke hva jeg skal gjøre med informasjonen
}
function closeconfirmation() {
document.getElementById("conf").style.display = "none"
}
</script>
</main>
<main class="booking-container">
<div class="details">
<form>
<input type="text" placeholder="Navn" id="name" ><br>
<input type="date" placeholder="Dato" id="date">
<input type="number" placeholder="Antall" id="number"><br>
<input type="email" placeholder="E-mail" id="email"><br>
</form>
<button onclick="openconfirmation()">Bestill Bord</button>
</div>
<div class="confirmation" id="conf">
<div id="textconf"></div>
<button id="closebutton" onclick="closeconfirmation()">Lukk</button>
</div>
<script>
function openconfirmation() {
let name = document.getElementById("name").value
let email = document.getElementById("email").value
let date = document.getElementById("date").value
let number = document.getElementById("number").value
if (name != "" && email != "" && date != "" && number != "") {
let time = (Math.floor(Math.random() * 12) + 12) + ":30"
document.getElementById("conf").style.display = "block"
document.getElementById("textconf").innerHTML = "Takk " + name + " du har fått bord for " + number + " folk på " + date + " kl " + time
}
// Vet ikke hva jeg skal gjøre med informasjonen
}
function closeconfirmation() {
document.getElementById("conf").style.display = "none"
}
</script>
</main>
</body>
</html>