Spaces:
Running
Running
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Website đặt chỗ</title> | |
</head> | |
<body> | |
<h1>Thông tin dặt chỗ</h1> | |
<form> | |
<label for="numGuest">Số khách tham dự bữa tiệc của quý khách: </label> | |
<input type="number" name="numGuest" id="numGuest"> | |
<label for="date">Ngày đặt: </label> | |
<input type="date" name="date" id="date"> | |
<br> | |
<label>Loại tiệc</label> | |
<input type="radio" name="partyType" id="breakfast" value="breakfast"> | |
<label for="breakfast">Tiệc sáng</label> | |
<input type="radio" name="partyType" id="lunch" value="lunch"> | |
<label for="lunch">Tiệc trưa</label> | |
<input type="radio" name="partyType" id="dinner" value="dinner"> | |
<label for="dinner">Tiệc tối</label> | |
<br> | |
<label for="age">Độ tuổi </label> | |
<select name="age" id="age"> | |
<option value="under18">Dưới 18 tuổi</option> | |
<option value="over18">Trên 18 tuổi</option> | |
</select> | |
<label>Giới tính: </label> | |
<input type="radio" name="gender" id="male"> | |
<label for="male">Nam</label> | |
<input type="radio" name="gender" id="female"> | |
<label for="female">Nữ</label> | |
<br> | |
<label for="referral">Quý khách biết tới chúng tôi qua: </label> | |
<select name="referral" id="referral"> | |
<option value="news">Báo chí</option> | |
<option value="google">Goolge</option> | |
<option value="youtube">Youtube</option> | |
<option value="facebook">Facebook</option> | |
</select> | |
<br> | |
<label for="requests">Các yêu cầu của quý khách: </label> | |
<br> | |
<textarea name="requests" id="requests" cols="100" rows="10"></textarea> | |
<br> | |
<button type="button" onclick="submitBooking()">Dặt chỗ</button> | |
</form> | |
</body> | |
<script> | |
function submitBooking() { | |
const numGuest = document.getElementById("numGuest").value; | |
const date = document.getElementById("date").value; | |
const partyType = document.querySelector('input[name="partyType"]:checked').value; | |
const age = document.getElementById("age").value; | |
const gender = document.querySelector('input[name="gender"]:checked').value; | |
const referral = document.getElementById("referral").value; | |
const requests = document.getElementById("requests").value; | |
window.location.href = "./thanks.html?numGuest=" + numGuest + "&date=" + date + "&partyType=" + partyType + "&age=" + age + "&gender=" + gender + "&referral=" + referral + "requests=" + encodeURIComponent(requests); | |
} | |
</script> | |
</html> |