function validateForm() {
var x = document.forms["confirm"].value;
if (x != "") {
alert("Thank you for your booking! We look forward to seeing you on soon!");
} else {
alert("Please enter a date for your booking!");
}
}
<form name="confirm" onsubmit="return validateForm()" method="post">
<input type="date" id="booking" name="booking">
<input type="submit" value="Book Now">
</form>
I want the alert to say thank you for the booking with any date entered, and please input a date if the box is empty. Thanks!