Copied to clipboard

Flag this post as spam?

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


  • Graham Carr 277 posts 389 karma points
    Oct 15, 2014 @ 18:09
    Graham Carr
    0

    Contour Functionality Feasibility Questions

    Umbraco Version: 6.0.5
    Contour Version: 3.0.21

    I am due to start a new project soon and need to ask some questions to see if what needs to be done is feasible using Contour or whether it needs to be done bespoke.

    1. The workflow consists of multiple steps that can veer off depending on selections on previous pages. E.g the first form page will take high level questions with a dropdown asking the type of request, depending on this selection a different set of forms will be displayed and indeed throughout the whole process pages might have one or more questions which might lead to different pages. I know the conditional arguments exist but that is on a page level whereas I want different form pages to be loaded depending on the selections.

    2. Ability to save progress through the request at any time with the ability to return to it at a later date.

    3. Progress tracker to allow the user to see how far they are through the request process

    Think of insurance quotation form workflows, this needs to be similar. Has anyone done anything similar with Contour before, or can you offer advice as to pursue this bespoke or via Contour?

    Thanks in advance.

  • Comment author was deleted

    Oct 16, 2014 @ 10:22

    Hey Graham,

    I would suggest that you give Contour a try, you can just download/install and use it on your local machine without any limitations.

    1)Conditions only exists on fields, there is currently no way of going to a different page depending on a field selection 

    2)Once a form step is submitted a record id will be created, this record id can be used to place a for in edit more, making it possible to return to a form on a later date (of course you have to store the record - member relation)

    3)This can be done by updating the views used to output the form http://our.umbraco.org/projects/umbraco-pro/contour/documentation/Developer/Custom-Markup/

  • Graham Carr 277 posts 389 karma points
    Oct 23, 2014 @ 11:13
    Graham Carr
    0

    Hi Tim,

    Thanks for the information, all useful and I have decided to try and give it a go with Contour. My main stumbling block however is that the form I am creating is quite large with a number of steps and I need to guide a user through the route for the selected request type with not every step being hit, I can do this on the Next button by having set the hidden field called "FormStep" to the next step associated with the type of request being performed and works fine. My issue is that I can't see a way of altering what step the user should be taken to when they click the "Previous" button.

    Do you have any ideas of how this could be done, wether via code or by jquery?

    Thanks,

    Graham

  • Comment author was deleted

    Oct 23, 2014 @ 11:30

    Haven't tried that but you could change the value of the hidden field when hitting the previous button, since previous will just go to formstep -1

    Not sure it will work though

  • Graham Carr 277 posts 389 karma points
    Oct 23, 2014 @ 11:36
    Graham Carr
    0

    Hi Tim,

    Just tried what you suggested and it works perfectly so thank you very much for that.

  • Comment author was deleted

    Oct 23, 2014 @ 11:37

    Great :)

  • Graham Carr 277 posts 389 karma points
    Oct 28, 2014 @ 11:50
    Graham Carr
    0

    Hi Tim,

    I have stumbled into another issue which I find very strange and not sure why it is happening. If I set the FormStep via jQuery and click the Next button all seems to work fine except that the values are not actually stored when I submit the form or re-open it for that matter, the same happens with the Previous button. If I click Next/Previous without setting the FormStep via jQuery then it saves the values fine.

    Do you have any idea why this might be happening?? For your reference this is the code I am running in a customised Form.cshtml specific to the form in question:

        <script type="text/javascript">
            $(document).ready(function () {
                $(".next").click(function () {
                    if($("#b0a3522d-4daa-47f1-8760-72107507afc6").val() != null) {
                        switch ($("#b0a3522d-4daa-47f1-8760-72107507afc6").val()) {
                            case "New starter":
                                $("#FormStep").val("3");
                                $("#RequestType").val("New Starter");
                                break;
                            case "Change of personal details":
                                $("#FormStep").val("4");
                                $("#RequestType").val("Change of Personal Details");
                                break;
                            case "Contract extension":
                                $("#FormStep").val("5");
                                $("#RequestType").val("Contract Extension");
                                break;
                            case "Contract amendment":
                                $("#FormStep").val("6");
                                $("#RequestType").val("Contract Amendment");
                                break;
                            case "Leaver":
                                $("#FormStep").val("7");
                                $("#RequestType").val("Leaver");
                                break;
                            case "Maternity/Adoption leave":
                                $("#FormStep").val("8");
                                $("#RequestType").val("Maternity/Adoption Leave");
                                break;
                        }
                    }
                    if ($(".nextpage").val() != null) {
                        var currentPage = parseInt($(".nextpage").val(), 10);
                        $("#FormStep").val(currentPage);
                    }
                });
                $(".cancel").click(function () {
                    $("#FormStep").val(2);
                    if ($(".previouspage").val() != null) {
                        var currentPage = parseInt($(".previouspage").val(), 10);
                        ++currentPage;
                        $("#FormStep").val(currentPage);
                    }
                });
            });
        </script>

     

     

  • Graham Carr 277 posts 389 karma points
    Oct 28, 2014 @ 12:55
    Graham Carr
    0

    I have attached some screenshots to show the difference between when the FormStep is set via jQuery and when it is set as normal. As you can see, another issue is that the validation is hit as soon as the form step appears when the step has been set via jquery as opposed to that not happening when the form step is left as normal. For your reference the PreviousFormStep and NextPageNumber are custom fieldtypes I have created to be able to specify which page should be shown on the next and previous button clicks as per the code above.

    FORM STEP SET AS NORMAL

     

    FORM STEP SET VIA JQUERY

     

  • Graham Carr 277 posts 389 karma points
    Oct 28, 2014 @ 13:04
    Graham Carr
    0
  • Graham Carr 277 posts 389 karma points
    Oct 31, 2014 @ 15:39
    Graham Carr
    0

    Does anyone have any thoughts as to why this issue is occuring, for the life of me I can't see why setting the FormStep value via jQuery would cause such a different effect than it being set normally?!?!? I have even tried setting up a very simple test form to test the case with only three steps and if I use the Preview functionality within the Contour admin the same effect occurs as well.

  • Graham Carr 277 posts 389 karma points
    Oct 31, 2014 @ 16:01
    Graham Carr
    0
Please Sign in or register to post replies

Write your reply to:

Draft