Overview
Controller Fields for Contact Form 7 is a simple plugin that extends the functionality of Contact Form 7.
When creating forms in Contact Form 7, all of your form fields are displayed. What you create in the form editor is what you get—there is no additional complexity to hide or show fields as a user goes through filling out the form. For example, you might have a form accepting billing and shipping addresses, but if those addresses are the same, you’d instruct the customer to skip those optional fields. There isn’t a way to make the shipping address fields required if they aren’t the same.
Controller Fields adds this feature by providing three “controller” form tags and a framework to control the visibility of groups of other form fields or content within the form. A better user experience in the example above would have a checkbox that asks if the user’s shipping address is different from their billing address, and if the user checks the box to indicate that it is different, required form fields would be revealed.
In short, Controller Fields allows you to hide or show other form fields based on user interaction.
Requirements
- An input element of type
select
,checkbox
, orradio
as the controller. The plugin does not currently support controllers of other form field types. - A unique
id
attribute on the controller form field.
Out of Scope
The Contact Form 7 – Dynamic Text Extension does not:
- work with fields other than
select
,checkbox
, andradio
inputs - change field values based on user interactions—controller fields only hide/display other elements
Demo
Click around, check it out!