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 438 posts 1653 karma points MVP 5x 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 29 posts 121 karma points
    Jul 25, 2018 @ 09:34
    Tim Mather
    0

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

  • Nathan Woulfe 438 posts 1653 karma points MVP 5x 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 29 posts 121 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 112 posts 584 karma points MVP 5x 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 173 posts 304 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 29 posts 121 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!!

  • Corey 5 posts 75 karma points
    Jul 16, 2020 @ 13:43
    Corey
    0

    Yes, please fix this issue. I can't believe it's been this long with no fix. I now have to write my own logic to work-around this broken feature.

  • Nikita Rawat 2 posts 71 karma points
    Oct 10, 2020 @ 12:17
    Nikita Rawat
    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.

  • thomaskin 1 post 71 karma points
    May 05, 2021 @ 13:34
    thomaskin
    0

    This is genuinely dumb, not actually a feasible item in the event that one of the significant capacities simply hasn't labored for a very long time.

  • mathewperry 2 posts 71 karma points
    Jun 07, 2021 @ 13:27
    mathewperry
    0

    I can't really accept that it's been this long. Is This a bug ?

  • Sven 32 posts 135 karma points
    Jun 16, 2021 @ 08:57
    Sven
    0

    Same here, conditional logic not working at all.

  • Sjaak van der Heide 30 posts 102 karma points
    Aug 09, 2022 @ 11:04
    Sjaak van der Heide
    0

    And a year later, still broken.

    At least for the conditions on the submit button. Still no luck anyone?

  • Andy Butland 407 posts 2269 karma points MVP 4x hq c-trib
    15 days ago
    Andy Butland
    0

    Hi - I've just been pointed to this discussion which I hadn't seen before. I've been doing some tests with conditions on the latest Umbraco 7 recently and it seems to be working OK to me (see comment here).

    The issue in the original post certainly looks wrong, but as far as I can tell this file isn't used. When rendering a form it's this file that's loaded into the browser: App_Plugins\UmbracoForms\Assets\themes\default\umbracoforms.js

    Maybe there's some context where the file is used and I'm not aware of though... so if someone is still having trouble and they can clearly raise the issue with replicable steps on the issue tracker, we can look further. Of course by now there have been several versions of Forms since V7 but if there are obvious, blocking bugs we'd still like to get them patched.

    Andy

Please Sign in or register to post replies

Write your reply to:

Draft