mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-12-29 01:52:24 +03:00
Prefill the form field though url parameters (#1021).
This commit is contained in:
parent
9097a968ca
commit
72baa18b86
1 changed files with 18 additions and 0 deletions
|
@ -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.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue