Nibble

Contour, disabling the auto resume feature

If you have a multistep form in Contour and the end users doesn’t fill in all the steps, the next time he visits the form he can simply continue where he stopped…

Currently it isn’t possible to disabled this resume funtionality in the UI but it’s pretty easy to do, it’s just a matter of removing a cookie.

Here is a snipped you can use (just make sure to set the correct form guid):

<script runat="server">
  protected override void OnLoad(EventArgs e){
 
            if (!IsPostBack)
 
            {
                int pageId = umbraco.presentation.nodeFactory.Node.GetCurrent().Id;
                string formId = "204188fc-509e-43e2-b04e-dcfde2e62158";
               
                if (Request.Cookies["contour_"+pageId+"_" +formId] != null)
                {
                    var contourCookie = Request.Cookies["contour_"+pageId+"_" +formId];
                    contourCookie.Expires = DateTime.Now.AddDays(-1d);
                    Response.Cookies.Add(contourCookie);
 
                    Response.Redirect(Request.Url.ToString());
                }
            }
 
        }
</script>

3 Comments so far

  1. Ismail Mayat on December 15th, 2010

    Tim,

    Awesome tip this will come in very handy.

    Regards

    Ismail

  2. Josh on June 20th, 2012

    Thanks Tim,
    This solved an issue I had with opening a form to edit, and deleting… After that any other records I opened for editing in that form would appear blank.
    Cheers
    Josh

  3. Martin on October 15th, 2012

    hi Tim,

    Does this still work with the current Contour?
    I tried adding it in a usercontrol to a macro so I could add this specifically to multistepforms (I am adding the macro the content editor), but it doesn’t seem to work.

    (umbraco 4.7, contour 1.1.13.2)

    regards,
    Martin

Leave a Reply