Booking 24 hours ahead of time
This WordPress form will only allow bookings that are at least booked 24 hours ahead of time. This can be useful for example reservations or renting services.
Last updated
This WordPress form will only allow bookings that are at least booked 24 hours ahead of time. This can be useful for example reservations or renting services.
Last updated
You can copy paste the below Form elements code under the [Code] tab on your form builder page
This form contains two input fields for the user to fill out:
Datepicker (named date
in this example)
Timepicker (named time
in this example)
The form will also contain four other fields to:
A Timepicker to set/grab the epoch of the current day @ 00:00 (start_time
)
A Timepicker to set/grab the epoch of the current date and time (current_time
)
A Calculator to add an additional 24 hours to the epoch based on the current date and time (future_timestamp
)
A Calculator the calculate the difference between the user's chosen date and time and the start time (diff_timestamp
)
Based on these values the epoch (timestamp) will be compared to the epoch that is 24 hours ahead of the current time. If the chosen date and time by the user is not 24 hours in the future the form will display a message (with the use of Conditional Logic) stating that they will have to pick a date and time that is at least 24 hours ahead in order to submit the form. When the selected date and time is 24 hours ahead of time a Submit button will be displayed to the user to submit the form.
Note: you will want to enable the option to "Prevent submitting form on pressing "Enter" keyboard button" under Form Settings > Form Settings on the builder page, so that the form can't be accidently submitted. This is a requirement because there is basically no validation applied on the form.