Copied to clipboard

Flag this post as spam?

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


  • Richard Thompson 14 posts 94 karma points
    Jul 11, 2023 @ 09:22
    Richard Thompson
    0

    Umbraco Forms Conditions not working

    Any Umbraco masters out there no why the condition fields don't seem to work in Umbraco forms.

    I've tried them on 'Groups' and on individual fields with no joy. Either I'm missing something obvious or it's a bit broke.

    We're running on Umbraco 10.5.1

    Any help/tips would be appreciated.

    Cheers

  • Alex Skrypnyk 6163 posts 24143 karma points MVP 8x admin c-trib
    Aug 23, 2023 @ 15:38
    Alex Skrypnyk
    0

    Hi Richard,

    did you find a solution? We have the same issue

    Thanks,

    Alex

  • Bjarne Fyrstenborg 1284 posts 4038 karma points MVP 8x c-trib
    Aug 23, 2023 @ 17:58
    Bjarne Fyrstenborg
    0

    Hi Richard

    Did you include the dependencies in frontend? https://docs.umbraco.com/umbraco-forms/developer/prepping-frontend/

    Not neccessay jQuery, but the conditional fields require a bit of JavaScript to toggle the fields.

  • Nidhi 34 posts 156 karma points
    Oct 06, 2023 @ 00:39
    Nidhi
    0

    Hi

    We are also getting the same issue and we have included the dependencies in the header but still the conditions doesn't work.

    Anyone found any solution to that?

    Thanks

  • Karl Tynan 16 posts 153 karma points MVP 5x c-trib
    Dec 11, 2023 @ 10:57
    Karl Tynan
    0

    I have also found this on 10.5.2 (non-jQuery approach), having followed all the steps for prepping front-end and adding scripts.

    There are no console errors and even switching to the "default" theme doesn't work for conditions.

  • Karl Tynan 16 posts 153 karma points MVP 5x c-trib
    Dec 11, 2023 @ 13:57
    Karl Tynan
    5

    I got it working...

    Basically, in a previous version of Umbraco Forms (I think we started with v10.2 perhaps) there was an update to use the umbraco-forms-hidden CSS class instead of style="display: none;" for conditional groups and fields. Because I was using a custom theme, this was missed during an upgrade.

    One other gotcha: I had to make sure that each field wrapper has @f.CssClass - this adds the appropriate fields for conditional showing/hiding too.

    Hope this helps!

  • Diedrik Kuypers 3 posts 74 karma points
    Dec 27, 2023 @ 09:55
    Diedrik Kuypers
    1

    Thanks Karl, you pointed me into the right direction. I had a custom theme for Umbraco Forms 11.1, and to make the conditional logic work in Umbraco Forms 13.0 I had to remove the style="display:none;" in Form.cshtml.

    The umbraco-forms-hidden CSS class is set by calling @f.CssClass, so this is what is left in my view:

    <div class="mb-4 @f.CssClass">
    ...
    </div>
    
  • Stefan Besteman 1 post 71 karma points
    Sep 25, 2024 @ 09:08
    Stefan Besteman
    0

    You also need the default forms stylesheet loaded or copy over the hide show classes to your own stylesheet

Please Sign in or register to post replies

Write your reply to:

Draft