Prevent meal requests beyond stay duration in hotel booking forms
When guests book a stay at a hotel, they are often asked for a few key details like when they’ll be arriving, when they plan to leave, and whether they’d like to include meals during their stay.
While this sounds simple, things can get tricky if the form allows guests to request meals for more days than they’re actually staying. For instance, a guest staying for 3 nights shouldn’t be able to request meals for 5 days.
To ensure a seamless and accurate reservation process, it’s important to build in logic that catches these inconsistencies before the form is submitted. This not only helps the hotel manage resources effectively but also prevents errors that could lead to billing issues or guest dissatisfaction.
So the objective here is to deny any form submission when the number of days for meal request exceeds the number of days of stay (days between the check-in and check-out dates).
So we first create a form with dedicated fields for check-in date, check-out date, and the number of days meals are required.

Logic
-
The difference between check-in and check-out gives the total number of days of stay.
-
Meals can be provided only for the number of days within this stay period.
-
If the user enters a value greater than the stay duration in the Number of days meals required field, the form submission should be denied.
To calculate the number of days between the check-in and check-out days, add a Formula field (name it as Number of days of stay) and configure the formula like this using the DayDiff function.
You can keep this Formula field hidden if you want to in the field properties as shown.
- In your form builder, navigate to the Rules tab and go to Deny Submissions.
- Click Configure Now.

-
Define the condition to deny form submissions:
If Number of Days you require meals is greater than Number of days of stay (select the Formula field), then show the denial message.

-
Click Add to view the rule summary.

If the respondent enters a number of meal days that exceeds their stay duration, the form will automatically deny submission.
