Fanny
July 29, 2024, 12:01pm
1
Is it possible to prefill a form using url parameters? How?
for example, if I have a form with name and email plus other fields, but I want to save time for the user to fill in the form, I would send the user a url like website/form?name=xxx&email=yyy
That would be awesome
Pakic
July 29, 2024, 11:46pm
2
Yes.
For example if input needs to take paramter name from url, in value of your input type:
${query->get('name')}
Fanny
July 30, 2024, 7:30am
3
Pakic:
${query->get('name')}
BRILLIANT !!
This is opening so many possibilities!
Many thanks!
Fanny
July 30, 2024, 7:35am
4
@Pakic How to avoid displaying “null” when accessing the form while no parameter is in the url?
Pakic
July 30, 2024, 12:59pm
5
${query->get('name', 'default value')}
in your case you can use empty string as default:
${query->get('name', ' ')}
2 Likes
Fanny
July 30, 2024, 1:02pm
6
Works perfect!!
Thank you!!!
system
Closed
August 1, 2024, 1:03pm
7
This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.