Custom Fields
Re-Envisioned
Support Meta Box Conditional Logic jQuery Validate still validating fields that hidden

  • Creator
    Topic
  • #18668
    Resolved Sofyan Sitorus
    Participant

    There is a case I need to hide a field using Meta Box Conditional Logic and set it as required, and the validation should executed only when the field is visible.

    I created a pull request in GitHub for the fixes:

    https://github.com/wpmetabox/meta-box/pull/1361

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #18669
    Anh Tran
    Keymaster

    Hi Sofyan,

    Thanks a lot for your help! I’ve merged your PR!

    #20334
    Ryan Lauritsen
    Participant

    Anh, does this apply to fields hidden via the CSS display: none;?

    We have some fields that are hidden using that method but still need validation (they are populated programmatically with some custom javascript). It was working fine but this or some other recent change has broken it. If I remove display: none; the validation works.

    #20336
    Long Nguyen
    Moderator

    Hi Ryan,

    Recently we’ve created an update to validate the field if it is visible. If a field is hidden by conditional logic, it will be ignored when running the validation. I’m going to create a request to support this case if the user needs to validate the hidden fields.

    #20340
    Ryan Lauritsen
    Participant

    Long Nguyen, when will this fix be ready?

    This has totally screwed up our data coming through multiple front-end forms and we need an immediate fix. Do I need to revert to an old version or is there a change I can make to the code to revert this temporarily until a fix is released.

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