• Resolved weroam

    (@philweroam)


    Hello,

    The conditional behavior described here: https://mc4wp.com/kb/conditional-fields-elements/ is not working for me.

    data-show-if= <— this just shows the data regardless for me at this point, here is my code:

    <p>
    <label>Remote?*</label>
    <select name=”MERGE1″ required>
    <option value=”Yes”>Yes</option>
    <option value=”No”>No</option>
    </select>
    </p>
    <p data-show-if=”MERGE1:No”>
    <p>
    <label>Plan to work*</label>
    <input type=”text” name=”MMERGE2″ required>
    </p>
    </p>

    As I understand it – the “Plan to work” section should only show if the first option select is ‘No’. However, it shows up from page load – even when there is no selection.

    Any help here is appreciated, thanks!
    Phil

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor Lap

    (@lapzor)

    Hi Phil,

    I just tested it on my own website and for me it works. What is the URL of your website, can you make a test page for me with this form so I can see why it doesn’t work for you?

    Thanks,

    Plugin Contributor Lap

    (@lapzor)

    FYI: The solution was not using nested P tags.

    So instead of
    <p data-show-if=”MERGE1:No”>
    <p>
    <label>Plan to work*</label>
    <input type=”text” name=”MMERGE2″ required>
    </p>
    </p>

    it should be

    <p data-show-if=”MERGE1:No”>
    <label>Plan to work*</label>
    <input type=”text” name=”MMERGE2″ required>
    </p>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘data-show-if= — Conditional not working’ is closed to new replies.