Appointments icon indicating copy to clipboard operation
Appointments copied to clipboard

Prefill input fields with url parameters

Open ImaCrea opened this issue 5 years ago • 2 comments

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.

ImaCrea avatar Oct 20 '20 21:10 ImaCrea

Good idea.

SergeyMosin avatar Nov 21 '20 14:11 SergeyMosin

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;
    });

niels-heinemann avatar Jul 11 '21 19:07 niels-heinemann