Getting autocomplete forms to work

Posted by Community Admin on 04-Aug-2018 19:49

Getting autocomplete forms to work

All Replies

Posted by Community Admin on 14-Jan-2013 00:00

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

Posted by Community Admin on 16-Jan-2013 00:00

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

This thread is closed