Appointments
Appointments copied to clipboard
Prefill input fields with url parameters
Hi there, thank you very much for this great app.
I was wondering if there was a way to prefill some input fields through parameters set in URL?
For instance, apps/appointments/pub/_RWu%2Be%2B6rpbWsQ%3D%3D/form?name=cat&[email protected] would load the form with appropriate fields already filled.
Good idea.
I've done this with Javascript loader app and
// Prefill forms, pattern prfl_<input-id>=value
(new URL(window.location.href))
.searchParams.forEach((x, y) =>{
if (y.indexOf('prfl_') == 0)
document.getElementById(y.substring(5)).value = x;
});