For some reason this doesn’t make the “errorJS” div visible. Can someone please help me?
function checkLogin()
{
document.getElementById("errors").style.display = "none";
var form = document.getElementById("form1");
var problems = false;
document.getElementById("errorJS").innerHTML = "";
if(form.email.value.length < 1)
{
document.getElementById("errorJS").innerHTML += "Please enter your email address. <br />";
problems = true;
document.getElementById("errorJS").style.display = "box";
}
if(form.pword.value.length < 1)
{
document.getElementById("errorJS").innerHTML += "Please enter your password.";
problems = true;
alert(document.getElementById("errorJS").style.display);
document.getElementById("errorJS").style.display = "box";
}
return !(problems);
}
Stupid me, I can’t believe I made that mistake. I’ve been coding more too many straight hours. Thanks to all for the answers.
The value “box” is not accepted. It should be “block”.