Tet banner

Custom Fields
Re-Envisioned
Support General Fields - Posts are publishing even if 'Required' is true

  • Creator
    Topic
  • #30488
    Prabakaran Shankar
    Participant

    Hello,

    My post with custom fields conditions with required are publishing without any problem. what to do to enable the required condition to work?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #30496
    Long Nguyen
    Moderator

    Hi,

    If the field is hidden by the conditional logic, the validation will be ignored. Refer to this commit https://github.com/wpmetabox/meta-box/pull/1361

    #31764
    Prabakaran Shankar
    Participant

    Thank you very much for your reply. However, it is not due to the validation. It is due to the tab wrap. I have custom fields that are wrapped in the tabs. The custom fields in the inactive tabs are not working as it is.

    The 'required' condition for data in the inactive tabs are not working. The 'required' condition only works in the active tab.

    Is there any way to overcome that?

    Thanks!

    #31774
    Long Nguyen
    Moderator

    Hi,

    The field in the inactive tab will be considered as a hidden field so it will not be validated. It is expected behavior. However, I will inform the development team to consider covering this case.

    #31777
    Prabakaran Shankar
    Participant

    Thank you very much for escalating this issue to DEV.

    Is there any alternative way to override this?

    #31778
    Prabakaran Shankar
    Participant

    Is there any option to save the draft even the validation is not met?

    Because, in my case, there are a lot of data (custom fields) that are not saved in the DB is a bit of a complication for us.

    Are there any codes to save the content in the DB (save draft) before the validation of the fields especially 'required' attributes?

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