R
Richard John
Can someone please help explain why the HTML/Javascript code snippet shown below
works in Firefox and Chrome, but not in IE7.0. I've worked on it for a couple of
days now, and can't see where the problem is. The code displays two radio
buttons (yes or no). Click on "yes" and the contents (2 check boxes) enclosed
within the DIV element, id="volunteer", are made visible. (Ordinarily wouldn't
have worried, but unfortunately, everything *has* to work in IE for
now.....before deployment):
<html>
<head>
<script type="text/javascript" language="javascript">
<!--
function showhide(objectname)
{
if (document.all)
return document.all[objectname];
else
return document.getElementById(objectname);
}
// **********
function hidevolunteer() {
showhide("volunteer").style.display = 'none';}
// **********
function showvolunteer(){
showhide("volunteer").style.display = '';}
//-->
</script>
</head>
<body>
Can you donate skills and time as a Volunteer?
<input type="radio" name="volunteer" value="-1" onClick="showvolunteer()" />Yes
<input type="radio" name="volunteer" value="0" onClick="hidevolunteer()" />No
<div id="volunteer" style="display:none">
If yes, then what skills can you offer?
<input type="checkbox" name="skills" value="Training" />Trainer
<input type="checkbox" name="skills" value="Demonstrator" />Demonstrator
</div>
</body>
</html>
Your help will be most appreciated. A working version (in FF and Chrome anyway)
is available at http://tinyurl.com/clcj63
Thanks
works in Firefox and Chrome, but not in IE7.0. I've worked on it for a couple of
days now, and can't see where the problem is. The code displays two radio
buttons (yes or no). Click on "yes" and the contents (2 check boxes) enclosed
within the DIV element, id="volunteer", are made visible. (Ordinarily wouldn't
have worried, but unfortunately, everything *has* to work in IE for
now.....before deployment):
<html>
<head>
<script type="text/javascript" language="javascript">
<!--
function showhide(objectname)
{
if (document.all)
return document.all[objectname];
else
return document.getElementById(objectname);
}
// **********
function hidevolunteer() {
showhide("volunteer").style.display = 'none';}
// **********
function showvolunteer(){
showhide("volunteer").style.display = '';}
//-->
</script>
</head>
<body>
Can you donate skills and time as a Volunteer?
<input type="radio" name="volunteer" value="-1" onClick="showvolunteer()" />Yes
<input type="radio" name="volunteer" value="0" onClick="hidevolunteer()" />No
<div id="volunteer" style="display:none">
If yes, then what skills can you offer?
<input type="checkbox" name="skills" value="Training" />Trainer
<input type="checkbox" name="skills" value="Demonstrator" />Demonstrator
</div>
</body>
</html>
Your help will be most appreciated. A working version (in FF and Chrome anyway)
is available at http://tinyurl.com/clcj63
Thanks