diff --git a/assets/js/pages/booking.js b/assets/js/pages/booking.js index 3d60454f..654db3d8 100644 --- a/assets/js/pages/booking.js +++ b/assets/js/pages/booking.js @@ -220,9 +220,27 @@ App.Pages.Booking = (function () { .text(index + 1) ); } + + prefillFromQueryParam('#first-name', 'first_name'); + prefillFromQueryParam('#last-name', 'last_name'); + prefillFromQueryParam('#email', 'email'); + prefillFromQueryParam('#phone-number', 'phone'); + prefillFromQueryParam('#address', 'address'); + prefillFromQueryParam('#city', 'city'); + prefillFromQueryParam('#zip-code', 'zip'); } } + function prefillFromQueryParam(field, param) { + const $target = $(field); + + if (!$target.length) { + return; + } + + $target.val(App.Utils.Url.queryParam(param)); + } + /** * Remove empty columns and center elements if needed. */