More in this section

Forums / Developing with Sitefinity / Getting autocomplete forms to work

Getting autocomplete forms to work

2 posts, 0 answered
  1. Randy
    Randy avatar
    7 posts
    Registered:
    07 Nov 2012
    14 Jan 2013
    Link to this post

    We have an issue with getting our login form to autocomplete.  We submitted a ticket but it seems that we are stuck with this since we are using claims based authentication and its a known issue with Sitefinity that they are looking to overcome.  

    "The usual auto complete is provided as a feature from the browser. With the new Claims Authentication in Sitefinity the frontend login form does not submit a form but makes an AJAX request. Browsers do not detect this as submission and do not remember the values of the text fields."


    In the mean time has anyone found a workaround that worked for them?  We are unable to switch to forms based authentication.


    Thank you

  2. Atanas Valchev
    Atanas Valchev avatar
    414 posts
    Registered:
    04 Jan 2016
    16 Jan 2013
    Link to this post
    Hi Randy,

     Thanks for using Sitefinity.

    That statement is 100% true. It is usually handled by the browser, however, you can do some client-side handling if you want some sort of autocomplete to work.

    You can start by creating a cookie that holds the username values submitted.

    function createCookie(name,value,days) {
        if (days) {
            var date = new Date();
            date.setTime(date.getTime()+(days*24*60*60*1000));
            var expires = "; expires="+date.toGMTString();
        }
        else var expires = "";
        document.cookie = name+"="+value+expires+"; path=/";
    }


    So when the button is clicked to log in you could call this function to create a cookie

    First, though check if the cookie exists

    function  checkCookie(name)
    {
         var cookie = readCookie(name);
        if (cookie != null)
        {return true;}
        else {return false;}
    }




    Kind regards,
    Atanas Valchev
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered