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.
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.
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 :-)
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.
@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
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.
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
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!
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
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
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
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
@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:
Thanks Tim. Will try it now :)
Comment author was deleted
Great, let me know if that does the trick
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.
is working on a reply...