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.


For example…

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.

Comments (3)

Hello, could you help me with a problem I have with conditional logic? I have some hidden fields of this type, a selector of whether or not you want to do freelance work, if you give some options such as years of experience and select the profession, now the field of professions I did it with a selector2 and when selecting That profession opens the options of those professions, the problem I have is that I leave it with selector2 because that way the user could select more than one profession to have more than one, but if you select one their options appear, if you select 2 they disappear , it is as if when selecting more than one the logic stops working and they do not appear, I leave you the piece of code that I have created

any solution for this problem? Greetings.

Conditional Fields are not currently compatible with a multi select. You could add each individual profession as a checkbox or yes/no and set conditional fields based on those fields.

Leave a Reply

For faster support related to issues on your specific site please open a ticket in our members support area.

Your email address will not be published. Required fields are marked *