Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefill input fields with url parameters #145

Closed
ImaCrea opened this issue Oct 20, 2020 · 4 comments
Closed

Prefill input fields with url parameters #145

ImaCrea opened this issue Oct 20, 2020 · 4 comments

Comments

@ImaCrea
Copy link

ImaCrea commented Oct 20, 2020

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&mail=[email protected] would load the form with appropriate fields already filled.

@ImaCrea ImaCrea changed the title Prefill input with url parameters Prefill input fields with url parameters Oct 20, 2020
@SergeyMosin
Copy link
Owner

Good idea.

@niels-heinemann
Copy link

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

@rgon
Copy link

rgon commented Aug 5, 2024

@SergeyMosin I have implemented this feature in PR #537

For ease-of-use, it follows the same standard as cal.com

https://mycloud.tld/appointments/appointmentID?name=UserName&email=userEmail&hidePrefilledInputs=true

@SergeyMosin
Copy link
Owner

V2.1.9

Settings > Form Settings > Advanced Form Settings > Allow Prefilled Inputs | Prefilled Inputs Appearance

Next step is to add auto-prefill for logged-in users as per #56


image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants