>
Login Page remember me functionality using javascr...
Welcome, Guest

by vineet on Tuesday, 09 December 2008
Login Page remember me functionality using javascript


Remember me functionality using javascript and cookie need to provide user name password will automaticlly read by javscript function and will add to textbox...

 <div  class="inputSection">
                    <input type="checkbox" id="rememberMe" /> Remember me
                    <script language="javascript">
                        if(getCookie('UserName')!='' && getCookie('UserName')!=null) {
                            document.getElementById('rememberMe').checked=true;
                            document.getElementById('txtUser').value=getCookie('UserName');
                            document.getElementById('txtPass').value=getCookie('Password');
                        }
 </script>
                  
 </div>

 

in javascript

if(rememberMe.checked==true)
        {
            setCookie('UserName',txtUser.value,'');
            setCookie('Password',txtPass.value,'');
        }
        else
        {
            setCookie('UserName','','');
            setCookie('Password','','');
        }

cookie.js

function getCookie(name) {
//alert('name');
  var dc = document.cookie;
  var prefix = name + "=";
  var begin = dc.indexOf("; " + prefix);
  if (begin == -1) {
    begin = dc.indexOf(prefix);
    if (begin != 0) return null;
  } else
    begin += 2;
  var end = document.cookie.indexOf(";", begin);
  if (end == -1)
    end = dc.length;
  return unescape(dc.substring(begin + prefix.length, end));
}

function deleteCookie(name, path, domain) {
  if (getCookie(name)) {
    document.cookie = name + "=" +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    "; expires=-1";
  }
}

function setCookie(name, value, expires, path, domain, secure) {
   
    path="/";
    var curCookie = name + "=" + escape(value) +
      ((expires) ? "; expires=" + expires.toGMTString() : "") +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "") +
      ((secure) ? "; secure" : "");

  document.cookie = curCookie;
}



Blogger Image
My Blog Title

Product Engineering, software engineering company, Product Development, Product Migration, Product Re-engineering, Product Maintenance, Product Testing Commercial Application Development, Business Software development, commercial software for startups, Application Support and Maintenance, software testing Product Maintenance, Outsource product maintenance, product support and maintenance Product Migration, Product Re-engineering, product re-engineering services Product Research, Product Engineering, UI Prototyping Services Software Testing Services, Quality Assurance services, professional software testers, Load Testing, Functional Testing, Cross Platform, Browser Testing, Test Automation, Testing Tools, software quality analysis Functional Testing Services, software quality analysis, Software Testing Services, Application Testing Services, Functional Testing Types Automated Testing, Automated Testing Services, automation testing, test script development, Automation Test Tools, outsource automation testing Load Testing, Performance Testing Services, Load Testing Tools Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering Benefits of IT Outsourcing, Offshore Software Development companies, offshore software development firms Outsource planning, IT outsourcing, IT development services, offshore IT companies, offshore software development Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering