Support

Account

Home Forums Bug Reports Conditional hidden fields not validating on save when required

Solving

Conditional hidden fields not validating on save when required

  • Hi,

    I’m getting a validation error when saving pages that have required fields that are not displayed because of “Conditional Logic”. I’ve used the conditional logic on a lot of sites, but something seems to be broken because the fields would validate before if they were required but empty and not shown.

    I’m using “Advanced Custom Fields PRO” version 5.7.6. I’ve tested turning off all other plugins, but the issue persists. I’m also experiencing the issue on three different sites – one hosted on my local computer and two at WP Engine.

    For clarification the issue is:
    I have a WYSIWYG field with “Conditional Logic” to show field if another field has a value equal to X, and I have “Required” toggled on the WYSIWYG field.

    If the other field’s value is Y, so WYSIWYG field is not shown and I save the page, I get “Validation failed. 1 field requires attention”. All fields shown on the page are set. When I change the other field’s value to X, I see “Second Column Text value is required” above the WYSIWYG field that was hidden when I saved the page.

    I use this logic to optionally require different fields quite often, but it seems to be broken in the current version of the ACF pro plugin.

    Thank you for looking into the issue.

  • Whoa – after more testing, I found the validation error only happens if I try to change the parent page. I can edit other fields on the page and it validates as I expect it to.

    I also found the same issue on another site on a WooCommerce product. The validation error happens on a required, but hidden and empty WYSIWYG field, and only when changing the Product Category. I can make changes to other fields and the product validates, even with the hidden, empty, required field.

  • I am also seeing this behavior. ACF Pro 5.7.6 and WP 4.9.8 running on WP Engine. The only way I have been able to change the parent is to use the Nested Pages plug-in and drag and drop the specific page but that will still throw a validation error when you go to make any other changes to the page.

    Any workarounds or updates on the horizon?

  • Same here with ACF Pro 5.7.6 and WP 4.9.8.

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Conditional hidden fields not validating on save when required’ is closed to new replies.