I would like to show certain information and also provide the user with the option to view other information. At the moment, the view/hide function works, but not in the correct way as it displays the information and clicking on 'view' hides it. Also this only works for the first row in the main table.
<SCRIPT>
function toggle(e)
{
if (e.style.display == "none"
{
e.style.display = "";
}
else
{
e.style.display = "none";
}
}
</SCRIPT>
<tr>
<td width="100%" height="61" align="left" valign="top"> <b>Systems:</b>
<%
tSQL ="SELECT Systems.System, Prod_Areas.[Production Area], Systems.Description FROM Prod_Areas INNER JOIN Systems ON Prod_Areas.PArea = Systems.PArea WHERE (Prod_Areas.[Production Area] = '"&(parea)&"')"
RS1.Open tSQL, DB%>
<table border="1" width="100%" height="1">
<div style = "cursor: hand" onClick = "toggle(document.getElementById('HideShow'));">
View
</div>
<span style = "color: blue" id = HideShow>
<%If RS1.EOF and RS1.BOF Then
Response.Write "There are no systems listed for this production area"
Else%>
</span>
<%RS1.MoveFirst
While Not RS1.EOF%>
<tr>
<td width="50%" height="1"><%Response.Write RS1.Fields ("System"
%></td>
<td width="50%" height="1<%Response.Write RS1.Fields ("Description"
%></td>
</tr>
<%RS1.MoveNext
Wend
End if%>
</table>
<%RS1.close%>
</tr>
Any ideas?
<SCRIPT>
function toggle(e)
{
if (e.style.display == "none"
{
e.style.display = "";
}
else
{
e.style.display = "none";
}
}
</SCRIPT>
<tr>
<td width="100%" height="61" align="left" valign="top"> <b>Systems:</b>
<%
tSQL ="SELECT Systems.System, Prod_Areas.[Production Area], Systems.Description FROM Prod_Areas INNER JOIN Systems ON Prod_Areas.PArea = Systems.PArea WHERE (Prod_Areas.[Production Area] = '"&(parea)&"')"
RS1.Open tSQL, DB%>
<table border="1" width="100%" height="1">
<div style = "cursor: hand" onClick = "toggle(document.getElementById('HideShow'));">
View
</div>
<span style = "color: blue" id = HideShow>
<%If RS1.EOF and RS1.BOF Then
Response.Write "There are no systems listed for this production area"
Else%>
</span>
<%RS1.MoveFirst
While Not RS1.EOF%>
<tr>
<td width="50%" height="1"><%Response.Write RS1.Fields ("System"
<td width="50%" height="1<%Response.Write RS1.Fields ("Description"
</tr>
<%RS1.MoveNext
Wend
End if%>
</table>
<%RS1.close%>
</tr>
Any ideas?