Hello all-
I have a page with two <div>'s on it. I have a link that appears within one of the div's. When the user clicks on the link, I want it to hide that div, and show the other. This seems like it should be simple, however I keep running into an Object Required issue, and I'm not sure why. Here is the code which defines the two DIV's within a panel:
Then here is the actual link that is contained inside of the Results Div:
Then lastly, here is my javascript to hide one and show the other.
Right now what happens when I click the link is that it does successfully hide the Results Div. But then I can see an error in IE that says "Object Required" when it's trying to make the AlertGroupResults Div visible.
Any idea what I'm messing up?
I have a page with two <div>'s on it. I have a link that appears within one of the div's. When the user clicks on the link, I want it to hide that div, and show the other. This seems like it should be simple, however I keep running into an Object Required issue, and I'm not sure why. Here is the code which defines the two DIV's within a panel:
HTML:
<asp:Panel ID="ResultPanel" runat="server" Height="100%" ScrollBars="Auto" Style="width: 99%; height: expression(document.body.clientHeight - 168); left: 4px; position: absolute; top: 188px;" Width="100%" CssClass="common">
<div style="width: 100%; height: 100px; left: 4px; top: 2px;" class="container" id="Results" runat="server">
</div>
<div style="width: 100%; height: 100px; left: 4px; top: 2px;" class="container" id="AlertGroupResults" runat="server" visible="false">
<asp:Label ID="Label7" runat="server" Text="This is a test."></asp:Label></div>
</asp:Panel>
Then here is the actual link that is contained inside of the Results Div:
HTML:
<td class='cell'><A id = 'displayText' HREF = 'javascript:hideDiv();'>Link</A></td>
Then lastly, here is my javascript to hide one and show the other.
JavaScript:
<script type="text/javascript">
function hideDiv() {
document.getElementById("Results").style.visibility = "hidden";
document.getElementById("AlertGroupResults").style.visibility = "visible";
}
</script>
Right now what happens when I click the link is that it does successfully hide the Results Div. But then I can see an error in IE that says "Object Required" when it's trying to make the AlertGroupResults Div visible.
Any idea what I'm messing up?