I have an unusual error as follows. When I am using my webpage in IE 32bit. In all other browsers it works fine. My error as follows:
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)
Timestamp: Mon, 23 May 2016 14:53:02 UTC
Message: 'which' is null or not an object
Line: 37
Char: 2
Code: 0
My code as follows:
function btn_contactus_clicked() {
window.location.href = "ContactUs.jsp";
}
function btn_login_click()
{
//if (typeof alert_vu !== "undefined") {
// tcalert_close("alert_vu");
//}
document.getElementById("msg").value = "";
if (document.getElementById("input_username").value.trim() === "") {
document.getElementById("msg").value = "Invalid user name!";
} else {
if (document.getElementById("input_password").value.trim() === "") {
document.getElementById("msg").value = "Invalid password!";
} else {
//Add checks for valid username from db here
}
}
if (!(document.getElementById("msg").value === "")) {
// One or more values entered is incorrect
tcalert("alert_login", document.getElementById("msg").value);
} else {
// All values entered are good
document.getElementById("alert_login").innerHTML = "";
document.form_login.submit();
}
}
document.onkeydown = function(e) { submitClick(e);};
function submitClick(e){
if(e.which === 13){
btn_login_click();
}
}
Please guide me what is the error. It is a simple login page.