I have a subscription form here https://step2you.divhunt.website/inscription which objective is to collect subscription of schools.
Each teacher can register a school and one class and submit, but in some cases, the teacher might need to enroll several classes.
In this case, in order to make subscription process easy, I would like to have 2 buttons:
simple submission: for direct submission of one class
submit and add new: to submit class subscription and then redirect to same form, this time pre-filled with email and school information so they only need to provide class information. The teacher could then loop as many times as they have classes to enroll without having to fill in again the same school information, and at the last class, they would perform the simple submit (first button).
A. (How) can I achieve this?
B. Can I use the code redirect solution for button 2 only?
C. Can I use form prefill in the button 2 redirect url? (how do I catch field values to put them in the url parameters?)
Maybe I was not clear in my post: there is only one form.
I want to be able to loop into this form after submission as many times as needed for the subscriber, but have information prefilled in subsequent loops (e.g. first/ last name and email will always be the same, so I don’t want them to have to fill in again)
You could activate the autofill browser property in the form controls (Divhunt frontend). Not as effective and still requires action on user side, but quick and easy.
Write custom code, that puts the desired values into global variables after the first form submit. And simultaneously use this vars as prefill in the form fields. This would also require to set the vars with default values.
1=> already configured, but indeed it still requires end user action
2=> I am very interested to get more info on how to do that !
Question: how will it work if different people submit a form almost simultaneously?
For now, I have configured the form fields to be prefilled using url parameters, and it works well.
I was actually thinking of this second button to redirect on such url.
Or maybe I should use only one button doing this, and user would simply exit the tab in case no more subscriptions are needed. Not sure what is the most efficient way to do that.
after submission, I have configured a section which is visible on successful submission. In this section, I have included 4 buttons (because there are 4 possible programs to subscribe from).
For each button, I have configured a link towards the specific program page, and added parameters in the url in order to prefill the next form with already entered data . This is what each each link looks like: /inscription-cap-ten?prenom=${query->get('prenom','')}&nom=${query->get('nom','')}&email=${query->get('email','')}&tel=${query->get('tel','')}&zip=${query->get('zip','')}&ville=${query->get('ville','')}&etablissement=${query->get('etablissement','')}
Prerequisite: the user should land on the form using a url with these parameters filled in in the url. In this particular case, they are invited to subscribe via email containing personalized url.