Login: Username: Password: Forgot Password? function ValidUnamePwd() { if (trim(document.getElementById("Username").value) == "" || trim(document.getElementById("Password").value) == "") { alert("Username or Password can't be empty."); return false; } else {return true;} } function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g, ""); } // Code to Display Alert to User If Invalid credentials.. starts Here function getQuerystring() { var url = window.location.href; if (url.indexOf("?Error") != -1) { var Ourl = url.split("?Error="); alert(unescape(Ourl[1])); window.location.href = Ourl[0]; } } window.onload = getQuerystring; // Code to Display Alert to User If Invalid credentials.. ends Here