Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Set Form fields defaults from plugin

Started by Muut Archive 10 years ago · 1 replies · 719 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 Muut Archive, 10 years ago
1 673 1 week ago
Archive · by Deleted User, 9 years ago
0 3043 9 years ago
Archive · by Muut Archive, 9 years ago
2 1983 9 years ago
Archive · by Muut Archive, 9 years ago
2 5336 9 years ago
Archive · by Muut Archive, 9 years ago
1 4134 9 years ago