Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nathan Woulfe 392 posts 1481 karma points MVP 3x c-trib
    Apr 05, 2018 @ 08:44
    Nathan Woulfe
    1

    Conditional fields not working

    I'm having problems with conditional fields in Forms 6.0.6 - they don't show up, ever.

    I've eliminated all the obvious things (dependencies are loaded, no CSS conflicts etc), and found that in umbracoforms-conditions.js there's a reference to .contourField:

        for (fieldId in fieldConditions) {
            handleCondition($("#" + fieldId).closest(".contourField"), fieldId, fieldConditions[fieldId], "Field");
        }
    

    That code is looping through the conditions for each form field, where the handleCondition function toggles show/hide on first argument, which should be the ancestor element of the input and its label, selected by the input ID (the fieldId value, in this case)

    Truncated for brevity:

    <div class="umbraco-forms-field name shortanswer mandatory">
        <label for="837db468-9dec-4a91-d45a-757759c97c49" class="fieldLabel"> Name <span class="contourIndicator">*</span></label>
        <div><input type="text" name="837db468-9dec-4a91-d45a-757759c97c49" id="837db468-9dec-4a91-d45a-757759c97c49" class="text" value="" maxlength="500" data-val="true" data-val-required="Please provide a value for Name">
        </div>
    </div>
    

    However, notice the selector used in closest() -> .contourField. That doesn't exist in my rendered forms, instead (as expected in Forms), the class is .umbraco-forms-field.

    This issue appears on the contact form on umbraco.com (that's where the code snippets are from).

    Is this a genuine bug, or are we just doing something screwy?

    cheers, champions Nathan

  • Nick Renny 31 posts 63 karma points
    Jun 19, 2018 @ 12:48
    Nick Renny
    0

    I've come across this too, I think it's a bug

  • Tim Mather 13 posts 105 karma points
    Jul 25, 2018 @ 09:34
    Tim Mather
    0

    Has there been a solution to this, we have the same problem.

  • Nathan Woulfe 392 posts 1481 karma points MVP 3x c-trib
    Jul 25, 2018 @ 10:04
    Nathan Woulfe
    0

    As far as I know, it's still an issue (still open on the tracker).

    I resolved it for our site by editing the JavaScript to use the correct selector.

    Forms is tricky, would be a simple PR but it's not open source...

  • Tim Mather 13 posts 105 karma points
    Jul 25, 2018 @ 10:08
    Tim Mather
    2

    This is fairly daft, not really a viable product if one of the major functions just hasn't worked for 3 months.

  • Al Burns 49 posts 149 karma points
    Jul 25, 2018 @ 10:58
    Al Burns
    0

    I am experiencing the same issue with a condition on a radio button value not working at all. This has worked for us in the past on version 6.0.2 of the forms but in version 7.0.1 it is no longer working.

  • Marcin Zajkowski 98 posts 559 karma points MVP 3x c-trib
    Jul 19, 2019 @ 13:49
    Marcin Zajkowski
    0

    Years are passing by and it's still there... Has anyone made Umbraco Forms working with the latest v7 and conditions and can share the code with all the replacements/fixes applied?

    Maybe then we can send it to Umbraco to include it for the next patch release...

  • Kenny Burns 172 posts 302 karma points
    Mar 12, 2020 @ 15:49
    Kenny Burns
    0

    Still an issue in Umbraco Forms 7.3.1

    The fix above works - changing contourField to umbraco-forms-field at the bottom of umbracoforms-conditions.js

    This should be a relatively straightforward fix, so i'm surprised its still knocking around.

  • Tim Mather 13 posts 105 karma points
    Mar 12, 2020 @ 18:56
    Tim Mather
    0

    Fairly rediculous this now, needs sorted, especially considering we are being charged £200 for a license!!

Please Sign in or register to post replies

Write your reply to:

Draft