Custom Fields
Support Meta Box Group Default empty w/required fields

This topic contains 1 reply, has 2 voices, and was last updated by  Anh Tran 1 year ago.

  • Creator
  • #11613

    Currently the group plugin with cloneable set forces at least one entry to display when adding a brand new post (for example). This causes an issue when one or more of the fields are required. We would like a way to have zero or more values in the group but if the user adds a value, they must fill in any required fields.

    Any thoughts?

Viewing 1 replies (of 1 total)
  • Author
  • #11618

    Anh Tran


    I think if you mark a field required, the browser will force you to enter a value. It works per field, which means it doesn’t depend on values of other fields. So no matter that field is in a group or not, if it’s required, it should have a value.

    I’d suggest using custom JavaScript code to check the emptiness of a group (clone) before submitting the post, and not using the required featured. This way, you control when and how the field is “required”.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.