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
I am using Torro forms and trying to figure out how do I set a default value for a text field, and specifically for date field. I would like it to be initialized with the current date whenever the form opens. Could not find any documentation mentioning the issue.
Thanks in advance
D
Steps to Reproduce (for bugs)
Expected Behavior
Current Behavior
Possible Solution
Screenshots / Video
Related Issues and/or PRs
Todos
Tests
Documentation
The text was updated successfully, but these errors were encountered:
You need to define a element template file under src/templates/element-yourelementname.php and define this behaviour by your PHP-code in there.
Therefore you can start by just copying the best matching template file from torro-forms to your plugin project or even better directly use element-date.php from plugin boilerplate and update it where needed.
E.g. you could check if $value has already been set and otherwise output the default value as field value.
Issue Overview
I am using Torro forms and trying to figure out how do I set a default value for a text field, and specifically for date field. I would like it to be initialized with the current date whenever the form opens. Could not find any documentation mentioning the issue.
Thanks in advance
D
Steps to Reproduce (for bugs)
Expected Behavior
Current Behavior
Possible Solution
Screenshots / Video
Related Issues and/or PRs
Todos
The text was updated successfully, but these errors were encountered: