function login() { $("#btnLogin").attr("disabled", "disabled"); $('.loading_login').show(); var email = document.getElementById("txtLoginEmail").value; var password = document.getElementById("txtLoginPassword").value; if (email == "" || password == "") { alert('Fill up data'); $('.loading_login').hide(); return; } else { /* send the link to fetch details */ var input = email + " " + password; /* detect by space */ $.ajax( { type: 'POST', url: 'ChangePassword.asmx/Login', data: '{\'inputText\':\'' + input + '\'}', dataType: 'json', contentType: 'application/json; charset=utf-8', success: function (response) { if (response != null && response.d != null) { alert('done'); if (response.d != "Success") { $("#btnLogin").prop("disabled", false); alert('Wrong email & password !'); $('.loading_login').hide(); } else { $("#btnLogin").prop("disabled", false); window.location = "home.aspx"; alert('welcome'); $('.loading_login').hide(); } } }, failure: function (response) { $("#btnLogin").attr("disabled", "disabled"); alert('Sorry! Operation failed.'); alert(response.d); $('.loading_login').hide(); }, error: function (response) { $("#btnLogin").attr("disabled", "disabled"); alert('Sorry! Error.'); alert(response.d); $('.loading_login').hide(); }, }); } clearAll(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)