Home Forums General Issues Required sub_fields Reply To: Required sub_fields

  • The default setup doesn’t allow required sub-fields in Repeater fields I don’t think. This doesn’t mean to say you can’t come up with your own solution though.

    I’d approach this in either 2 routes:

    1) Create bit of jQuery that sits on the edit pages of WP and doesn’t allow the post to be Published until the required sub-fields are validated.

    2) Simply add conditional code to wherever you are using the sub-fields data to not output the element if the sub-field isn’t populated (I do this often for things like captions or titles in repeater fields)

    If you need help with the first bit of JS let me know as i’ve written something similar for a major project that required custom validation of ACF fields.