In my web-application I have added javascript in a jsp file.
The alert message is popping up in Firefox. But the alert window is not working in IE 8. Following is the javascript that I am using.
Can anyone please tell how to make this work in IE 8?
function doSubmit() {
var checkbox = document.getElementById("terms");
if (!checkbox.checked) {
alert("error message goes here.");
return false;
} else {
return true;
}
}
Works fine, here is how you use it!
added correction as suggested.