Copied to clipboard

Flag this post as spam?

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


  • Adriana Cerqueiro 38 posts 177 karma points
    Dec 10, 2018 @ 13:52
    Adriana Cerqueiro
    0

    Form conditional fields when empty

    Good afternoon everybody.

    I was wondering if it is possible to have a conditional field that displays if a previous field is not empty; but stay hidden until the user fills the field.

    For example:

    Field company: empty - Field jobTitle (not shown)

    Field company: Umbraco - Field jobTitle can then be displayed.

    I have been trying, but I can't seem to figure it out.

    Thank you very much!!

    -Adri

  • Ultradata 16 posts 108 karma points
    Dec 10, 2018 @ 22:44
    Ultradata
    0

    Does this work?

    conditions

  • Adriana Cerqueiro 38 posts 177 karma points
    Dec 10, 2018 @ 23:19
    Adriana Cerqueiro
    0

    Hey Ultradata.

    It doesn't =( I also tried it the other way around "show if is not " and then I left the field empty, no value.

    Neither options works.

  • Sjoerd Stottelaar 31 posts 189 karma points
    Oct 10, 2019 @ 09:24
    Sjoerd Stottelaar
    0

    Did you find a solution to this issue? I'm running into the same issue right now, would love to know how you solved it!

  • Adriana Cerqueiro 38 posts 177 karma points
    Oct 10, 2019 @ 09:51
    Adriana Cerqueiro
    0

    Hey Sjoerd, unfortunately I didn't. I left the second field visible for now =(

  • Sjoerd Stottelaar 31 posts 189 karma points
    Oct 10, 2019 @ 09:58
    Sjoerd Stottelaar
    0

    I got it working! Did you use a custom template for UmbracoForms? We do, and we didn't include the following:

    <div class="umbraco-forms-page">
    ... Form goes here
    </div>
    

    I noticed in the validation scripts that it look for that class when it initializes the conditional logic. Without it it won't work for me.

    Now I can use the following condition:

    enter image description here

    And it shows the field whether or not the hidden field 'Product key' contains a value.

    Hope this helps!

Please Sign in or register to post replies

Write your reply to:

Draft