What is wrong with this javascript?
- by bala3569
i use this javascript syntax for validating a checkbox...
alert(document.getElementById("ctl00_ContentPlaceHolder1_Chkreg").checked);
if (document.getElementById("ctl00_ContentPlaceHolder1_Chkreg").checked == false) {
document.getElementById("ctl00_ContentPlaceHolder1_ErrorMsg").innerHTML = "please select the checkbox";
document.getElementById("ctl00_ContentPlaceHolder1_Chkreg").focus();
return false;
}
My alert showed me false but my if loop is not working... Any suggestion...