Copied to clipboard

Flag this post as spam?

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


  • Simon steed 374 posts 686 karma points
    Aug 15, 2011 @ 10:42
    Simon steed
    0

    Does Contour support conditional fields based upon user selection?

    I've got a requirement with a current client to replace their existing .net logic forms with contour. At the moment a number of questions are asked in a wizard style interface i.e.

    Name, address, DOB etc etc Address uses a web service to lookup so question 1 is can this be easily integrated into the contour workflow (currently implemented as a popup form).

    Then the user is asked for their occupation. If for instance they select Joiner then they can carry onto the next stage i.e. financial details. However if they answer Medical, the existing site displays a new section (postback and unhides a div) to ask more specific medical role type questions like time in role, time spent in clinic, more filtered down picklists etc

    At the moment I cannot see how this can be achieved - currently i'm getting the core users details and then passing onto the prebuilt user controls for this extra info - obviously i'd like to replace all this with Contour logic so the client can add their own stages without needing me to develop the forms - cannot see how but I know conditional fields were promised over a year ago for 1.1 release.

    Any ideas?

    Cheers

    Simon

  • Tim 1193 posts 2675 karma points MVP 3x c-trib
    Aug 15, 2011 @ 12:31
    Tim
    0

    Hi Simon,

    Sadly, there's no support for conditional fields at the moment (I'd quite like a feature like this too). You could do this with JQuery, if the additional fields are o the same page as the dropdown. Basically, add an onload event to the page to hide the extra fields, and then attach an event to the dropdown that checks if the required value is selected, and if so, unhides the extra fields.

    We've done a much more basic version of this, where if someone selects "other" from a dropdown, an extra text field appears for them to add in the other text.

    If you wanted to direct to a different stage in the form, that might be a bit more complex. I think (although I'm not 100% certain, it was a long time ago) that Ismail Mayat managed to do a workflow that allowed you to redirect to a different step in the form.

    Hope that helps!

  • Simon steed 374 posts 686 karma points
    Aug 15, 2011 @ 12:49
    Simon steed
    0

    Hi Tim

    Thanks for clarifying this, i'll drop Ismail a line and see what he says - not sure i'm going to have time to roll out a full solution for this so may need to stick with the UC method for now and work on something in the background time permitting :-)

    Cheers

    Si

  • Ismail Mayat 4511 posts 10090 karma points MVP 2x admin c-trib
    Aug 16, 2011 @ 11:51
    Ismail Mayat
    0

    Simon,

    I have done multi page form see http://www.world-of-incentives.com/request-for-proposal.aspx but its not conditional. The only way you could do conditional is write workflow step to determine which step to show next.  Im sure you could make the workflow item generic so that it takes a step to goto although how you would set the condition that is another matter. Possibly write your own simple script type thing which is free text box bit like

    {FieldName}

    {ValueToCheck}

    {NextStepIftrue}

    Then in your workflow parse that and do something with it.  Not very clean also would need the client to be able to use it.  I would think the reason we dont have conditional fields yet is that its not as simple to implement.


    Regards

     

    Ismial

  • Ashraf 4 posts 24 karma points
    Dec 07, 2012 @ 17:44
    Ashraf
    0

    Is this functionality added as part of latest Contour release ? Can we add conditionally add fields to the contour form using codefirst?

  • Comment author was deleted

    Dec 10, 2012 @ 10:11

    Hi Ashraf, yes conditional logic is now possible http://umbraco.com/follow-us/blog-archive/2012/11/7/contour-30-features-conditional-logic.aspx

    However it isn't supported using code first yet, it will be in the next maintenance release...

  • Comment author was deleted

    Dec 10, 2012 @ 11:21

    @Ashraf, if you upgrade the code first assembly to 3.0.2 WIP (http://nightly.umbraco.org/Umbraco%20Contour/)you can have conditional logic in code first

    Here is an example:

            [Field("Leave a comment""Your comment",
                EnableCondition = true,
                ConditionActionType = FieldConditionActionType.Show,
                ConditionLogicType = FieldConditionLogicType.Any)]
            [FieldConditionRule("Name",FieldConditionRuleOperator.Is, "Test")]
            public string Hidden { getset; }
  • Ashraf 4 posts 24 karma points
    Dec 10, 2012 @ 12:29
    Ashraf
    0

    Thanks Tim. Will try it now :)

  • Comment author was deleted

    Dec 10, 2012 @ 13:28

    Great, let me know if that does the trick

  • Nicolás Cova 48 posts 120 karma points
    Jul 14, 2014 @ 22:39
    Nicolás Cova
    0

    Hi Tim,

    Sorry to revive an old thread. Is there conditional logic support for DropDownLists? In your example above, the field titled "Name" is a Textfield (I saw your example in your blog). In my case I need to monitor the value of a DropdownList in order to make another field show. I've been going at it for a couple of minutes and all I get are YSOD's.

Please Sign in or register to post replies

Write your reply to:

Draft