WordPress Registration Form Plugin (CMREG) - How To - Hide or Display Fields Dynamically (Conditional Logic)


Hiding or Displaying Registration Fields Dynamically (Conditional Logic)

Back to User Guide

What Is This Feature

Starting from version 2.8.0 of the WordPress Registration Form Plugin, it's possible to hide or display registration fields based on certain conditions.

Use Case Example

The registering user can choose between "Free User" or "Premium User" 

  • Choosing "Free User" displays the fields
    • Email
    • Password
  • Choosing "Premium User" displays the fields
    • Email
    • Password
    • Referral
    • Premium Plan

You can add one logical condition to either a required field or an optional field. 

In both cases, the first option will hide the desired fields and the second option will display all. If there are three or more options, they will also display all fields.


Using This Feature

You must add certain tags to the CSS class of the relevant fields. 

First, edit the fields that will affect the conditions:

  • Optional fields - add hide_show_optional to the CSS class. Note: don't make affected fields Required!
  • Required fields - add hide_show_required to the CSS class

Then, edit the CSS class of the fields that will be affected.

  • Affected fields - add hide to the CSS class

Use Case Example - Part 2

Using the example from above:

  • Field User Type (Free User/Premium User) - This is a required field, so you should add to the CSS class hide_show_required

    Setting up the required type of the field - WordPress Plugin User Registration
    Setting up the required type of the field
  • Email - Will always appear, so the CSS class won't change

    Leaving the CSS Class field empty - User Registration WordPress
    Leaving the CSS Class field empty
  • Password -  Will always appear, so the CSS class won't change
  • Referral - Should be affected by the condition, so add hide to the CSS class

    Hiding the field - WordPress Login Plugin
    Hiding the field
  • Premium Plan - Should be affected by the condition, so add hide to the CSS class

More information about the WordPress Registration Form Plugin

Other WordPress products can be found at CreativeMinds WordPress Store

Let us know how we can Improve this Product Documentation Page

To open a Support Ticket visit our support center
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.