Custom Fields
Support Meta Box Conditional Logic Conditional Logic for hiding conflicts with required fields

  • Creator
  • #10479
    Resolved Doug

    I’ve discovered a conflict when Conditional Logic is used to limit visibility of a meta box to a specific page, and the same meta box contains a required field. For example, meta box is visible when post_ID = 25.

    Editing that specific page is fine. But since Conditional Logic hides the meta box (and its fields) on other pages, those pages can’t be updated, because the required field for those pages has no value.

    Maybe this is by design, since Conditional Logic doesn’t truly eliminate the meta box on other pages, it simply hides the meta box from view. (Although checkboxes for hidden meta boxes still show up in ‘Screen Options’ at the top of the page.)

    For now, I removed the required attribute on any fields in meta boxes that use Conditional Logic for visibility. Is there another way around this?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
  • #10480
    Anh Tran

    Hi Doug,

    I’m afraid this (removing the required attribute) is the only way to resolve this. The Conditional Logic actually hides/shows elements. It does not removes them completely from the page (cause it doesn’t know how to get them back).

    Austin Passy

    I would consider this a bug, and not a feature. I know there are ways to handle required fields only when visible. Hopefully it’s something you can work into in an upcoming release.

    If I had time to work on this I would. Might i suggest looking into Gravity Forms as they integration this into their conditional logic extension in 2011.

    Thanks for the extension.

    Anh Tran

    Hey guys,

    Finally we found a solution for this problem. It’s added in the version 1.6.0. Please update and let me know if you need anything further.

    Austin Passy

    Awesome, is this getting pushed into AIO?

    Anh Tran

    Just pushed to the AIO. Please check it.

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


Subscribe to our newsletter to receive news and tutorials for Meta Box and WordPress.

grid gear info copy caret-up caret-down trash