Skip to content
Home » Documentation » Controller Fields for Contact Form 7

Controller Fields for Contact Form 7

    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

    1. An input element of type select, checkbox, or radio as the controller. The plugin does not currently support controllers of other form field types.
    2. 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, and radio inputs
    • change field values based on user interactions—controller fields only hide/display other elements

    Demo

    Click around, check it out!

      Content below me will change based on your fruit of choice!

      How you like them apples?

      Bananas are my favorite fruit.

      I'd give this a 0/10 because it is not a dragon.


      Content below me will change based on your chosen drink(s)!

      I like both hot and frozen, I'm fire and ice, baby!

      Only Iced and frozen for me!

      I hate everything equally.


      Content below me will change based on your role!

      Give me everything you've got!

      I got 'chu fam

      YEET!