Can anyone explain why this script works in firefox but not ie7?
“Does Not Apply” should get unchecked if the user chooses any other options or types one in manually.
All other boxes should uncheck and the text field should clear if “Does Not Apply” gets checked.
Example: [url]http://www.olfactoryhues.com/temp/test.htm
My simplified code:
[CODE]
<html>
<head>
<title>test</title>
<script language=’JavaScript’>
function UncheckDNA(){
document.fruits.fruits[0].checked=false;
}
function UncheckALL(){
for (i = 1; i < document.fruits.fruits.length; i++) {
document.fruits.fruits[i].checked = false ;
document.fruits.NewFruit.value = ”;
}
}
</script>
</head>
<body>
<form name=’fruits’>
<input type=’checkbox’ id=’fruits’ name=’fruits[]’ value=” onchange=’UncheckALL();’ checked>Does Not Apply<br>
<input type=’checkbox’ id=’fruits’ name=’fruits[]’ value=’Apple’ onchange=’UncheckDNA();’>Apple<br>
<input type=’checkbox’ id=’fruits’ name=’fruits[]’ value=’Banana’ onchange=’UncheckDNA();’>Banana<br>
<input type=’checkbox’ id=’fruits’ name=’fruits[]’ value=’Orange’ onchange=’UncheckDNA();’>Orange<br>
<input type=’text’ name=’NewFruit’ size=’15’ onchange=’UncheckDNA();’>
<input type=’submit’ value=’Add’><br><br>
<input type=’submit’ value=’Submit’>
</form>
</body>
</html>
Any assistance you can offer would be greatly appreciated!
-Jack