another hide/show div problem
I thought I had my problem solved now my manager wants one item to show while the other hides. In a nutshell I have 2 divs that have radio buttons to show them. when one is clicked the other should hide but I've got it all screwed up. Here is the code I'm working with so far.
Thanks in advance
Amy
-------------
<script type="text/javascript">
<!-- Begin
var subs_array = new Array("sub1","sub2");// Put the id's of your hidden divs in this array
function displaySubs(the_sub){
if (document.getElementById(the_sub).style.display==""){
document.getElementById(the_sub).style.display = "none";return
}
for (i=0;i<subs_array.length;i++){
var my_sub = document.getElementById(subs_array[i]);
my_sub.style.display = "none";
}
document.getElementById(the_sub).style.display = "";
}
// End -->
</script>
------------------------------
<TABLE cellSpacing="1" cellPadding="1" bordercolor="#ff00ff" border="0">
<TR>
<TD class="Normal" width="160"> <input type="Radio" onclick="displaySubs('sub1')">Show Selected Accounts</TD>
<TD class="Normal" width="130"><input type="Radio" onclick="displaySubs('sub2')">Show All Accounts</TD>
</TR>
</TABLE>
-----------------
<div id="sub1" style="display:none" class="tag"> blah blah blah</div>
<div id="sub2" style="display:none" class="tag"> blah blah blah2</div>
|