Copied to clipboard

Flag this post as spam?

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


  • Gavin Williams 47 posts 220 karma points
    Nov 18, 2015 @ 10:15
    Gavin Williams
    0

    Conditional fields not working when form in a subfolder

    Using contour 3.0.27 and have found that if you create a form in a subfolder of the contour Forms tree, the conditional fields don't work. To replicate create a radiobuttonlist field "what is best, chocolate or crisps?". then create two text fields - "What is the best chocolate" and "what are the best crisps". Enable conditions on the two questions and map them to the chocolate and crisps radio responses. When you click a radio button, no text field is displayed. Now move the form to the root of the contour Forms folder and it now works. Has anyone experienced this or knows how to fix?

  • Gavin Williams 47 posts 220 karma points
    Nov 18, 2015 @ 10:59
    Gavin Williams
    0

    Have just noticed that the id of the div that encapsulates the form is including the / char of the form name so the id of the div is called "contourformtest/choccy"

    This is throwing an unrecognized expression error in jquery 1.9.1

    in the contourform.cshtml view, the div is just called contour, so the form name must be appended to it somehow. Does anyone know where this is done - i presume I need to modify something to filter out the / char

  • Gavin Williams 47 posts 220 karma points
    Nov 18, 2015 @ 13:41
    Gavin Williams
    0

    Ok figured it out. If anyone ever gets this issue here's how I fixed it:

    In the umbraco\plugins\umbracoContour\Views folder:

    Edit Form.cshtml and change this line:

    div id="contour_form_@{@Model.FormName.Replace(" ", "")}" class="contour @Model.CssClass"
    

    to this:

    div id="contour_form_@{@Model.FormName.Replace(" ", "").Replace("/", null)}" class="contour @Model.CssClass"
    

    Edit script.cshtml and replace any occurences of: Model.FormName.Replace(" ", null) to Model.FormName.Replace(" ", null).Replace("/", null)

Please Sign in or register to post replies

Write your reply to:

Draft