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

  • Creator
  • #18668
    Resolved Sofyan Sitorus

    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:

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

    Hi Sofyan,

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

    Ryan Lauritsen

    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.

    Long Nguyen

    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.

    Ryan Lauritsen

    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.