i cannot get this show/hide thing to work. it always shows the first <div>, which is the first table created from a matching value in my recordset.
here is my code:
<script>
function showHide(inDiv)
{
thisDiv = document.getElementById(inDiv);
if (thisDiv.style.display != "none"
{
thisDiv.style.display = "none";
}
else
{
thisDiv.style.display = "block";
}
}
</script>
Sub Input_Show()
<form method='get' name='uploadForm' action='Input.asp'>
<table border='1'><tr><td><select Name="sItem" onClick="showHide(sItem.value);return(false);"><option value="zero">---</option>
<% Search_Item %>
</td></tr>
<%
sql = "select item, field from wotrack.pivot_fields order by item, field"
openrs rs, sql
dim tempItem
dim displayString
with rs
.moveFirst
do while not .eof
<div id='" & .fields(0) & "' style='display:none;'><table border='1'>" &_
<tr><td>" & .fields(0) & "</td><td>" & .fields(1) & "</td></tr>"
tempItem = .fields(0).value
.moveNext
do while tempItem = .fields(0).value
<tr><td>" & .fields(0) & "</td><td>" & .fields(1) & "</td></tr>"
.moveNext
loop
</table></div>"
loop
end with
<tr><td colspan='2' align='right'><input type='submit' name='Submit' value='Submit'></td></tr></table></form>"
End Sub
here is my code:
<script>
function showHide(inDiv)
{
thisDiv = document.getElementById(inDiv);
if (thisDiv.style.display != "none"
{
thisDiv.style.display = "none";
}
else
{
thisDiv.style.display = "block";
}
}
</script>
Sub Input_Show()
<form method='get' name='uploadForm' action='Input.asp'>
<table border='1'><tr><td><select Name="sItem" onClick="showHide(sItem.value);return(false);"><option value="zero">---</option>
<% Search_Item %>
</td></tr>
<%
sql = "select item, field from wotrack.pivot_fields order by item, field"
openrs rs, sql
dim tempItem
dim displayString
with rs
.moveFirst
do while not .eof
<div id='" & .fields(0) & "' style='display:none;'><table border='1'>" &_
<tr><td>" & .fields(0) & "</td><td>" & .fields(1) & "</td></tr>"
tempItem = .fields(0).value
.moveNext
do while tempItem = .fields(0).value
<tr><td>" & .fields(0) & "</td><td>" & .fields(1) & "</td></tr>"
.moveNext
loop
</table></div>"
loop
end with
<tr><td colspan='2' align='right'><input type='submit' name='Submit' value='Submit'></td></tr></table></form>"
End Sub