Hi Angus,
Thanks for the information, worked a treat!
This is what I did:
==========================
1. I put this code in the head:
<script type=text/javascript>
var isNS = navigator.appName.indexOf("Netscape") != -1
var isIE = navigator.appName.indexOf("Microsoft") != -1
function show() {
if (isNS) document.layers["d1"].visibility = "show";
if (isIE) document.all.d1.style.display = "inline";
}
function hide() {
if (isNS) document.layers["d1"].visibility = "hide";
if (isIE) document.all.d1.style.display = "none";
}
</script>
2. I put this code in the body of the page:
<a href="javascript
:show()">CLICK ME TO SHOW TABLE 9</a>
<a href="javascript
:hide()">CLICK ME TO HIDE TABLE 9</a>
3. I place the DIV tas before and after the table I wanted to Show/Hide.
<DIV id="d1" style="display:none">
<TABLE ID="Table9">
<TR> etc, etc, etc
</TR>
</TABLE>
</DIV>
=======================================
This worked absolutely fine and the manual links to the javascript did indeed show and hide table 9.
I then tried to get clever and automate the show/hide depending on an asp test and it all went wrong
This is what I tried. I replaced the manual links:
<a href="javascript
:show()">CLICK ME TO SHOW TABLE 9</a>
<a href="javascript
:hide()">CLICK ME TO HIDE TABLE 9</a>
.... with the following script to check a database value to decide to show or hide the table:
<% if lcase(ors("ShowOrHide")) = "show" then %>
<script>
document.all.d1.style.display = "inline";
</script>
<%else %>
<script>
document.all.d1.style.display = "none";
</script>
<%
end if
%>
Trouble is, it doesn't work and I get an underfined 'd1' error message.
Where have I gone wrong?
Regards
Gary