Home Forums Front-end Issues Targeting ACF fields only in acf.conditional_logic.calculate


Targeting ACF fields only in acf.conditional_logic.calculate

  • In input.js, line 636, there is a query finding an ACF field’s value to match against another field’s conditional logic rules:

    // get val and make sure it is an array
    var val = $field.find('input, textarea, select').last().val();

    As I use a third-party jQuery plugin (Chosen) that inserts an internal search input field (without a name attribute), the ACF conditional logic fails, as the last input field is that search field.

    I solved it by filtering the selection with .filter('[name^="field"]') before doing the last() filter, which might be a good solution to this problem.

    • Elliot

    • September 30, 2013 at 3:17 pm

    Hi @alexanderwallin

    Thanks, I like the JS and I’ll add it in.


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.