Energon
06-05-2001, 02:39 PM
I have this code here in an html document:
<tr>
<td><b>Completed:</b></td>
<td>
<select name="completed" onChange="changeVisibility('divCompleted', this.options[this.selectedIndex].value)">
<option value="" selected>Any Completed and Not Completed</option>
<option value="yes">Completed Only</option>
<option value="no">Not Completed Only</option>
</select>
</td>
</tr>
<div id="divCompleted" style="visibility:visible">
<tr>
<td><b>Completion Date:</b></td>
<td><b>Not Available</b></td>
</tr>
<tr>
<td><b>Tech:</b></td>
<td><b>Not Available</b></td>
</tr>
</div>
<tr>
and here's the code for the javascript function, changeVisibility:
function changeVisibility(id, visibility)
{
document.write(visibility);
if(document.all) {
if(visibility == 'show' || visibility == "yes" || visibility == "")
xxxx("document.all." + id + ".style.visibility='visible';");
if(visibility == 'hide' || visibility == "no")
xxxx("document.all." + id + ".style.visibility='hidden';");
} else {
if(visibility == 'show' || visibility == "yes" || visibility == "")
xxxx("document.layers['" + id + "'].visibility='show';");
if(visibility == 'hide' || visibility == "no")
xxxx("document.layers['" + id + "'].visibility='hide';");
}
}
The error I get (in IE) is this:
document.all.divCompleted.style is null or ... I don't remember the very end of it, but it was something like saying it was empty or something... I've looked at my spelling through and through and that's not it... and all the code I'm using is stuff I wrote a little bit ago for the same basic situation, except that it worked with Radio Buttons rather than Select Boxes... and I don't remember changing anything other than it
being a select box now, so I'm really stumped by this...
hmm... it's not letting me put something
<tr>
<td><b>Completed:</b></td>
<td>
<select name="completed" onChange="changeVisibility('divCompleted', this.options[this.selectedIndex].value)">
<option value="" selected>Any Completed and Not Completed</option>
<option value="yes">Completed Only</option>
<option value="no">Not Completed Only</option>
</select>
</td>
</tr>
<div id="divCompleted" style="visibility:visible">
<tr>
<td><b>Completion Date:</b></td>
<td><b>Not Available</b></td>
</tr>
<tr>
<td><b>Tech:</b></td>
<td><b>Not Available</b></td>
</tr>
</div>
<tr>
and here's the code for the javascript function, changeVisibility:
function changeVisibility(id, visibility)
{
document.write(visibility);
if(document.all) {
if(visibility == 'show' || visibility == "yes" || visibility == "")
xxxx("document.all." + id + ".style.visibility='visible';");
if(visibility == 'hide' || visibility == "no")
xxxx("document.all." + id + ".style.visibility='hidden';");
} else {
if(visibility == 'show' || visibility == "yes" || visibility == "")
xxxx("document.layers['" + id + "'].visibility='show';");
if(visibility == 'hide' || visibility == "no")
xxxx("document.layers['" + id + "'].visibility='hide';");
}
}
The error I get (in IE) is this:
document.all.divCompleted.style is null or ... I don't remember the very end of it, but it was something like saying it was empty or something... I've looked at my spelling through and through and that's not it... and all the code I'm using is stuff I wrote a little bit ago for the same basic situation, except that it worked with Radio Buttons rather than Select Boxes... and I don't remember changing anything other than it
being a select box now, so I'm really stumped by this...
hmm... it's not letting me put something