mgva
10-29-2012, 06:49 PM
Hello,
I'm having a problem with this bit of javascript code:
<script language="javascript">
function myna(){
if(document.test.na.checked){
document.getElementById("start").style.visibility = "hidden";
document.getElementById("end").style.visibility = "hidden";
document.test.start_hour[0].selected = true;
document.test.start_minute[0].selected = true;
document.test.start_half[0].selected = true;
document.test.end_hour[0].selected = true;
document.test.end_minute[0].selected = true;
document.test.end_half[0].selected = true;
}
else{
document.getElementById("start").style.visibility = "visible";
document.getElementById("end").style.visibility = "visible";
}
}
</script>
It works fine in both Firefox and Chrome but not in IE 9. I would like the Start and End input fields to be hidden when the N/A checkbox is checked. However, in IE 9 the Start and End input fields are not hidden when I check the N/A checkbox. I do notice that if I click on another area of the page, the Start and End input fields become hidden. How do I get the code to properly work on IE 9?
Thanks!
I'm having a problem with this bit of javascript code:
<script language="javascript">
function myna(){
if(document.test.na.checked){
document.getElementById("start").style.visibility = "hidden";
document.getElementById("end").style.visibility = "hidden";
document.test.start_hour[0].selected = true;
document.test.start_minute[0].selected = true;
document.test.start_half[0].selected = true;
document.test.end_hour[0].selected = true;
document.test.end_minute[0].selected = true;
document.test.end_half[0].selected = true;
}
else{
document.getElementById("start").style.visibility = "visible";
document.getElementById("end").style.visibility = "visible";
}
}
</script>
It works fine in both Firefox and Chrome but not in IE 9. I would like the Start and End input fields to be hidden when the N/A checkbox is checked. However, in IE 9 the Start and End input fields are not hidden when I check the N/A checkbox. I do notice that if I click on another area of the page, the Start and End input fields become hidden. How do I get the code to properly work on IE 9?
Thanks!