Hello,
I'm using a radio button. Depending on the value, I need to show Tables1 /hide Table2 or vice-versa.
The problem is that I only see empty cells. Do I have to also show / hide each row of the tables ?
Here is an extract of my code:
<script type="text/javascript">
function showHideTable(TableShow,TableHide)
{
if (document.getElementById(TableShow).style.display== 'none')
{
document.getElementById(TableShow).style.display='block';
document.getElementById(TableHide).style.display='none';
}
else
{
document.getElementById(TableShow).style.display='none';
document.getElementById(TableHide).style.display='block';
}
}
</script>
<td><input id="rblChoice1" onclick="showHideTable('Table1','Table2');" type="radio" runat="server" onserverclick="rblChoice_SelectedIndexChanged">
Choice1<br>
<input id="rblChoice2" onclick="showHideTable('Table2','Table1');" type="radio" runat="server" onserverclick="rblChoice_SelectedIndexChanged">
Choice2</td>
<table id="Table1" cellSpacing="2" cellPadding="2" border="1" runat="server">
<tr>
<td vAlign="top"><asp:label id="lbl1" runat="server" Visible="False">bla bla</asp:label></td>
</tr>
</table>
<table id="Table2" cellSpacing="2" cellPadding="2" border="1" runat="server">
<tr>
<td vAlign="top"><asp:label id="lbl2" runat="server" Visible="False">bla bla</asp:label></td>
</tr>
</table>
I'm using a radio button. Depending on the value, I need to show Tables1 /hide Table2 or vice-versa.
The problem is that I only see empty cells. Do I have to also show / hide each row of the tables ?
Here is an extract of my code:
<script type="text/javascript">
function showHideTable(TableShow,TableHide)
{
if (document.getElementById(TableShow).style.display== 'none')
{
document.getElementById(TableShow).style.display='block';
document.getElementById(TableHide).style.display='none';
}
else
{
document.getElementById(TableShow).style.display='none';
document.getElementById(TableHide).style.display='block';
}
}
</script>
<td><input id="rblChoice1" onclick="showHideTable('Table1','Table2');" type="radio" runat="server" onserverclick="rblChoice_SelectedIndexChanged">
Choice1<br>
<input id="rblChoice2" onclick="showHideTable('Table2','Table1');" type="radio" runat="server" onserverclick="rblChoice_SelectedIndexChanged">
Choice2</td>
<table id="Table1" cellSpacing="2" cellPadding="2" border="1" runat="server">
<tr>
<td vAlign="top"><asp:label id="lbl1" runat="server" Visible="False">bla bla</asp:label></td>
</tr>
</table>
<table id="Table2" cellSpacing="2" cellPadding="2" border="1" runat="server">
<tr>
<td vAlign="top"><asp:label id="lbl2" runat="server" Visible="False">bla bla</asp:label></td>
</tr>
</table>