Hi,
I have an asp page to show and hide table, the code is as follow:
<html>
<head>..............</head>
<script language="javascript" >
function ShowAll( ){
var remove_el=document.all.remove
remove_el.style.display=''
}
function HideAll( ) {
var remove_el=document.all.remove
remove_el.style.display='none'
}
function Show(argDiv ){
if (argDiv=='A'){ var remove_el=document.all.TableA; }
if (argDiv=='B'){ var remove_el=document.all.TableB; }
if (argDiv=='C'){ var remove_el=document.all.TableC; }
for (i=0;i<remove_el.length ; i++)
remove_el.style.display=''
}
function Hide(argDiv){
if (argDiv=='A'){ var remove_el=document.all.TableA; }
if (argDiv=='B'){ var remove_el=document.all.TableB; }
if (argDiv=='C'){ var remove_el=document.all.TableC; }
for (i=0;i<remove_el.length ; i++)
remove_el.style.display='none'
}
</script>
<body onload="HideAll( )">
<%
....
'create Table1
</table>
...
<td><a href="javascript:Show('A');">display A</a></td></tr>
...
<td><a href="javascript:Show('B');">display B</a></td></tr>
...
<td><a href="javascript:Show('C');">display C</a></td></tr>
</table>
....
<a href="javascript:ShowAll( );">show all</a>
.............
'create TableA
<div id="remove">
<table id="TableA">
.........
<th><a href="javascript:Hide('A');">QtyA</a></tr>
.........
</table>
........
'create TableB
<table id="TableB">
.........
<th><a href="javascript:Hide('B');">QtyB</a></tr>
.........
</table>
.......
'create TableC
<table id="TableC">
.........
<th><a href="javascript:Hide('C');">QtyC</a></tr>
.........
</table>
</div>
%>
When I first load it,
1.Table1 display successfully;
2. TableA, B, C all hidden;
Click on display A,
1. does not display TableA
Click on display B,
1. does not display TableB
Click on display C
1. does not display TableC
Click on show all,
1. display all 3 TableA, B, C
Click on QtyA,
1. hide TableA
Click on QtyB,
1. hide TableB
Click on QtyC
1. hide TableC
Further Click on show all,
1. does not display the 3 TableA, B, C
Further Click on display A,
1. show TableA
Further Click on display B,
1. show TableB
Further Click on display C
1. show TableC
Please help to find out:
why the first time click on display A or display B or display C do not show the corresponding table;
why the show all only show the 3 tables once - after the first time display it won't show the 3 tables again;
Thanks in advance,
William
I have an asp page to show and hide table, the code is as follow:
<html>
<head>..............</head>
<script language="javascript" >
function ShowAll( ){
var remove_el=document.all.remove
remove_el.style.display=''
}
function HideAll( ) {
var remove_el=document.all.remove
remove_el.style.display='none'
}
function Show(argDiv ){
if (argDiv=='A'){ var remove_el=document.all.TableA; }
if (argDiv=='B'){ var remove_el=document.all.TableB; }
if (argDiv=='C'){ var remove_el=document.all.TableC; }
for (i=0;i<remove_el.length ; i++)
remove_el.style.display=''
}
function Hide(argDiv){
if (argDiv=='A'){ var remove_el=document.all.TableA; }
if (argDiv=='B'){ var remove_el=document.all.TableB; }
if (argDiv=='C'){ var remove_el=document.all.TableC; }
for (i=0;i<remove_el.length ; i++)
remove_el.style.display='none'
}
</script>
<body onload="HideAll( )">
<%
....
'create Table1
</table>
...
<td><a href="javascript:Show('A');">display A</a></td></tr>
...
<td><a href="javascript:Show('B');">display B</a></td></tr>
...
<td><a href="javascript:Show('C');">display C</a></td></tr>
</table>
....
<a href="javascript:ShowAll( );">show all</a>
.............
'create TableA
<div id="remove">
<table id="TableA">
.........
<th><a href="javascript:Hide('A');">QtyA</a></tr>
.........
</table>
........
'create TableB
<table id="TableB">
.........
<th><a href="javascript:Hide('B');">QtyB</a></tr>
.........
</table>
.......
'create TableC
<table id="TableC">
.........
<th><a href="javascript:Hide('C');">QtyC</a></tr>
.........
</table>
</div>
%>
When I first load it,
1.Table1 display successfully;
2. TableA, B, C all hidden;
Click on display A,
1. does not display TableA
Click on display B,
1. does not display TableB
Click on display C
1. does not display TableC
Click on show all,
1. display all 3 TableA, B, C
Click on QtyA,
1. hide TableA
Click on QtyB,
1. hide TableB
Click on QtyC
1. hide TableC
Further Click on show all,
1. does not display the 3 TableA, B, C
Further Click on display A,
1. show TableA
Further Click on display B,
1. show TableB
Further Click on display C
1. show TableC
Please help to find out:
why the first time click on display A or display B or display C do not show the corresponding table;
why the show all only show the 3 tables once - after the first time display it won't show the 3 tables again;
Thanks in advance,
William