Skip to content
● Grav 2.2 is out: 2x faster cold starts and 96% less memory on big sites. Read the announcement →

Set Form fields defaults from plugin

Started by Muut Archive 10 years ago · 1 replies · 663 views
10 years ago

I have a simple front end contact form and added another field for text input. The form is completely defined in the frontmatter and operates as shown in the grav documentation. I want to use a plugin to prefill that added field dynamically to a variety of things. I am able in the form definition to set a "default" value, but that is not dynamic. In my plugin, what event would I use to get access to the form field parameters and re-set the default value before the form is displayed? So a more general question I guess: How to use a plugin to set default values of form fields before form is displayed?

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 2548 9 years ago
Archive · by Muut Archive, 9 years ago
2 1675 9 years ago
Archive · by Muut Archive, 9 years ago
2 4960 9 years ago
Archive · by Muut Archive, 9 years ago
1 3787 9 years ago
Archive · by Muut Archive, 9 years ago
3 1791 9 years ago