I wish to show / hide table rows on my table based on the press of a button, and the default is to be hidden. here is what I have currently:
[code]
<span id=”spanQuoteInfo<%=i%>” style=”display: none”>
<tr>
<th></th>
<th nowrap><font face=”verdana” size=”1″>Quote Number</font></th>
<th><font face=”verdana” size=”1″>Part #</font></th>
<th nowrap><font face=”verdana” size=”1″>Cust Min Qty</font></th>
<th><font face=”verdana” size=”1″>Price</font></th>
<th><font face=”verdana” size=”1″>Date</font></th>
</tr>
<%
set rs1 = Server.CreateObject (“adodb.RecordSet”)
ssql = “SELECT QUOTES.[QUOTE #] AS Quote, [QUOTES DETAIL].CustMinQty, [QUOTES DETAIL].PRICE, QUOTES.[DATE] AS QuoteDate”
ssql = ssql & ” FROM [QUOTES DETAIL] INNER JOIN QUOTES ON [QUOTES DETAIL].[QUOTE #] = QUOTES.[QUOTE #]”
ssql = ssql & ” WHERE (QUOTES.CustNbr = ‘”&strCustNum &”‘) AND ([QUOTES DETAIL].[PART #] = ‘”&rs(“PartNum”)&”‘)”
rs1.Open ssql, dbc, adOpenForwardOnly, adLockReadOnly
do while not rs1.eof
%>
<tr>
<td></td>
<td><font face=”verdana” size=”1″><a href=”Quote_Info1-ajax.asp?CustNum=<%=strCustNum%>&QuoteNum=<%=rs1(“Quote”)%>”><%=rs1(“Quote”)%></font> </td>
<td><font face=”verdana” size=”1″><%=rs(“PartNum”)%></font> </td>
<td><font face=”verdana” size=”1″><%=rs1(“CustMinQty”)%></font> </td>
<td><font face=”verdana” size=”1″><%=rs1(“PRICE”)%></font> </td>
<td nowrap><font face=”verdana” size=”1″><%=rs1(“QuoteDate”)%></font> </td>
<%
rs1.moveNext
Loop
rs1.close
set rs1=nothing
%>
</span>
However, that code shows the information on default, it is not hiding it. I am guessing this is because a span can’t hide a table row or something like that.
So, how would I go about hiding the appropriate rows? Something like this?
<tr id=”QuoteHeader”>
for the header portion
<tr id=”QuoteDetails<%=i%>”>
for the details portion and I would have a counter for i
Have them all default to hidden
then, when show is clicked, it would show everything…here is my show code which fails currently…i get object exptected error:
[code]
function ShowQuoteInfo(i)
{
var strShowQuoteInfo = document.getElementById(“spanShowQuoteInfo” + i)
strShowQuoteInfo.style.display = (strShowQuoteInfo.style.display && strShowQuoteInfo.style.display==’block’ ? ‘none’ : ‘block’);
}
this is when I press this button:
[code]
<td><input type=”button” value=”show/hide” onClick=”ShowQuoteInfo(<%=i%>)” style=”font-family: Verdana; font-size: 7pt”></td>
can someone help me figure this out?