Copied to clipboard

Flag this post as spam?

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


  • Lesley 107 posts 349 karma points
    Apr 09, 2018 @ 22:12
    Lesley
    0

    Conditions not working

    I'm using Forms v7.0.1 with Umbraco v7.10.

    I've got a form with some optional questions that should be shown/hidden based on another question.

    If the user checks the "Do you want a second goal?" checkbox, then the Goal2 field should be displayed.

    When the form loads, the Goal2 field is hidden, however, checking the "Do you want a second goal?" checkbox doesn't do anything - the Goal2 field remains hidden.

    I've tried changing the "Do you want a second goal?" question to a Yes/No single choice field, but it still doesn't work.

    I'm rendering the forms scripts using

    @Umbraco.RenderMacro("RenderUmbracoFormScripts")
    

    and they are being added to the page.

    I can also step through the code in umbracoforms-conditions.js when the page is loaded.

    It just seems that there should be some javascript or something that executes when the user checks/unchecks the "Do you want a second goal?" question, but that doesn't seem to be happening..

  • Lesley 107 posts 349 karma points
    Apr 09, 2018 @ 23:15
    Lesley
    0

    I've got it working.

    Views\Partials\Forms\Script.cshtml is referencing contour classes, but the javascripts are looking for umbraco forms classes.

    Had to replace #contourform with #umbracoform

    and replace .contour-page with .umbraco-forms-page

  • Lesley 107 posts 349 karma points
    Apr 09, 2018 @ 23:51
    Lesley
    0

    I think the problem is that we are using the Form Picker datatype to select the form and not the macro, and so no theme is being supplied.

    The form seems to be rendered via the Themes\Form.cshtml, however because no theme is specified, it's using the non-themed Scripts.cshtml file.

  • Ben Margevicius 6 posts 77 karma points
    May 21, 2019 @ 20:58
    Ben Margevicius
    0

    I am just adding a note for my own sanity. This is v7.06 forms. In Views\Partials\Forms\Script.cshtml change:

    form = $("#contour_form_" + formId);
    form = $("#umbraco_form_" + formId);
    

    and find and replace

    $(".contourPage ...
    $(".umbraco-forms-page ....
    
Please Sign in or register to post replies

Write your reply to:

Draft