Reload the booking form when it is restored from the back-forward cache

After tapping "Sende" the submit button is locked to stop double
bookings. If the guest then pressed Back, the browser could restore that
snapshot with the button still locked and unusable. The form now reloads
in that case, matching the manage-booking page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Ubuntu
2026-11-23 11:27:56 +00:00
co-authored by Claude Opus 5.5
parent e3ba51b8e5
commit 72be52f06d
3 changed files with 24 additions and 0 deletions
@@ -213,6 +213,14 @@
$('#sendBooking').prop('disabled', true).val('Küldés...');
});
// Back button can restore this page from the browser cache with the
// submit button still locked - reload so the guest gets a fresh, usable form.
$(window).on('pageshow', function(e){
if(e.originalEvent && e.originalEvent.persisted){
window.location.reload();
}
});
$('#booking_time').change(function(){
if($('#booking_time').val() != ''){
$('#isTimeSelectedBtn').prop('disabled', false);