Our Register Helper Add On allows you to add fields to the member profile and checkout process. This post highlights the ability to set one field as dependent on another field’s value.
Here’s a code demo using the “depends” attribute of the Register Helper Add On for a selection of “Cat” or “Dog”. It displays the text input field “Cat’s Name” or “Dog’s Name” based on the selection.
While this is a fairly simple example, it shows how you can build a robust form with conditional entries to capture additional information at checkout or on the member profile. These fields can be used in your Member Directory and Profile pages, added to your third party email platform for enhanced targeting, or even duplicated as a member’s BuddyPress xProfile fields.
The Code Recipe
You’ll need to update the recipe for your own conditional fields, but this provides the basic overview of how to set a conditional field. See more documentation on conditional fields here.