Custom Fields
Support Meta Box Builder Conditional Logic based on selection in Checkbox List (using Meta Box Builder)

  • Creator
  • #9992
    Resolved admingemo


    I am trying to set visibility of an Advanced Select Box based on the checked value in a Checkbox List and I'm doing this via the Meta Box Builder extension in WP admin.

    Although the doco is very clear in terms of code to achieve this (at I am unsure what to select in the Builder UI.


    If the user checks 'Australia' in in my list of countries (checkbox_list), then the 'State - Australia' select box (select_advanced) will appear.

    'State - Australia' select_advanced >> Advanced >> Conditional Logic - the settings in this section are as follow:
    VISIBLE when ALL of these conditions match:
    [field] [operator] [value]

    FIELD: Unsure what to put... my 'checkbox_list' ID is c_country and the individual input checkboxes all have the name c_country[] in the admin edit screen source code
    OPERATOR: = or in or contains ?
    VALUE: Unsure whether to put "Australia" or 1/true (depends on earlier field/operator)

    I have played around with a few options that I thought corresponded to the equivalent code from the docs but don't seem to be getting it right because the 'select_advanced' field is permanently visible right now.

    Any guidance on the correct settings would be great. (Personally I would be comfortable coding it instead BUT I need to get familiar with the Builder interface so I can train my team.)

    Thank you!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
  • #10058
    Anh Tran

    Hello, please try this:

    Field: just use c_country
    Operator: contains. The value of a checkbox list is always an array. So it should "contains" your selection.
    Value: the value of "Australia" that you set in the Options list of the c_country field.

    Please try and let me know how it goes.


    Thanks Anh!

    Just gave that a shot (think it was one of the options I tried originally so good to know I was on the right track!) - but it does not seem to be working. 🙁

    The State (Australia) field is showing regardless of any ticked/not ticked status in Country

    Screenshot of settings and result:

    Anh Tran


    I've just tried to set similar to you, and it works for me. Let me show you a video:

    View post on

    I also tested with tabs and it still works. Can you try again with just 2 fields?

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.