jayshadow
06-14-2007, 04:14 PM
First, here's the lowdown. I'm pulling information from a database and it's creating radio button selections in a form. Also, it's creating hidden divs, naming the div id as the id of the the entry. For example...
<div id="$entryid">
Now when a radio button is selected, it shows the div with expanded information about the entry selected. My problem is, when a new radio button is selected, I can't get it to hide the div thats already being displayed. Here is a snipit of the code I'm using...
The DIV Style:
<style type="text/css">
div {
position:absolute;
left: 506px;
top: 300px;
width: 300px;
overflow:none;
text-align: left;
word-wrap: break-word;
vertical-align: top;
display: none;
}
</style>
The Javascript:
<script language="JavaScript">
function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}
</script>
The form buttons:
<input type="radio" name="entry" value="$entryid" onclick="setVisibility('$entryid', 'inline');setVisibility('??????','none');"> $entryname <br>
The DIV Creation:
<div id="$entryid">
Any ideas? Thank You!
<div id="$entryid">
Now when a radio button is selected, it shows the div with expanded information about the entry selected. My problem is, when a new radio button is selected, I can't get it to hide the div thats already being displayed. Here is a snipit of the code I'm using...
The DIV Style:
<style type="text/css">
div {
position:absolute;
left: 506px;
top: 300px;
width: 300px;
overflow:none;
text-align: left;
word-wrap: break-word;
vertical-align: top;
display: none;
}
</style>
The Javascript:
<script language="JavaScript">
function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}
</script>
The form buttons:
<input type="radio" name="entry" value="$entryid" onclick="setVisibility('$entryid', 'inline');setVisibility('??????','none');"> $entryname <br>
The DIV Creation:
<div id="$entryid">
Any ideas? Thank You!