You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great if the page https://docs.contao.org/manual/de/formulargenerator/formularfelder/ would have more information about default values of form fields, Especially about dynamic default values. E.g. How can I set the current date as the default value. Or how can I set a GET parameter as a default value.
The text was updated successfully, but these errors were encountered:
E.g. How can I set the current date as the default value. Or how can I set a GET parameter as a default value.
The recommended way in my opinion would be to use a loadFormField hook and then pre-fill the widget's value with whatever you need, while keeping security in mind.
I recently added this functionality to https://github.com/inspiredminds/contao-extended-form-fields though. With that extension installed you can enable a setting for each form field where its default value would be extracted from a query parameter of the same name.
Thank you Fritz. In the forums many write about another solution. That I would have to write something like {{GET:variableName}} into the default field. Hence I thought it would be great to have a better documentation about it. To have a solution is one thing. To have a better documentation another. And this issue here is now because of the documentation and not about finding a solution. But thanks again.
And this issue here is now because of the documentation and not about finding a solution.
I know ;). The ticket is not closed.
That I would have to write something like {{GET:variableName}} into the default field.
Probably something like {{file::get.php?…}}, but that's not very elegant and thus I would be reluctant to add that to the documentation as an official solution.
It would be great if the page https://docs.contao.org/manual/de/formulargenerator/formularfelder/ would have more information about default values of form fields, Especially about dynamic default values. E.g. How can I set the current date as the default value. Or how can I set a GET parameter as a default value.
The text was updated successfully, but these errors were encountered: