briancostea
Programmer
i have a web page where i return the results five pages at a time. everything seems to work fine except where i want to highlight the page the user is currently on. please see the following code (bold is the link that doesn't work):
''set intpage to page the user wants
Select Case Request("action")
case 0
intpage = Request("intpage") + 1
if intpage > pageCount then intpage = pageCount
if intpage < 1 then intpage = 1
case else
response.write "<br>correct spot::" & request("action") & "<br>"
intpage = request("action")
End Select
''display the results
If Not rsShw.EOF Then
%><form name=frmShw method=post action="dspmsg.asp">
<input type=hidden name=hid_Shw>
<%
rsShw.AbsolutePage = intpage
For intRecord = 1 To rsShw.PageSize
area = rsShw("area")
recNum = rsShw("record")
topic = rsShw("topic")
%><center><table width=420>
<tr><td width=100 align=left class=first><%=rsShw("mod")%></td><td width=220 class=first align=right><%=rsShw("crtDate")%></td><td width=100 class=first align=right><%=rsShw("replies")%> replies</td></tr>
<tr><td> <a href="prepare.asp?area=<%=area%>&record=<%=recNum%>" class=dspLink><%=topic%></a></td></tr>
</table></center><%
rsShw.MoveNext
If rsShw.EOF Then Exit For
Next
''show the rest of the pages user can see
<input type="hidden" name="intpage" value="<%=intpage%>">
<input type=hidden name=area value="<%=area%>">
<input type="hidden" name="action">
<center><table width=420><tr><td align=center><%
For intRecord = 1 To rsShw.PageCount
******* this is always false if i click a page # link
******* it works if if i click the Next link
if intpage = intRecord then
lnkClass = "dspLinkA"
else
lnkClass = "dspLink"
response.write "<br>in else for rec " & intRecord & ": intpage = " & intpage & "<br>"
end if
%>
****** here is the link that doesn't work ******
<a href="javascript:verify(this,<%=intRecord%>)" class="<%=lnkCLass%>"><%=intRecord%></a>
<%
Next%>
<a href="javascript:verify(this,0)" class=dspLink>Next</a></td>
</tr></table></center>
</form>
''javascript functions
function verify(obj,rec)
{
var recInt;
recInt = parseInt(rec);
document.frmShw.action.value = recInt;
document.frmShw.submit();
}
i'm not sure if it is something in the javascript function, or the way that "action" is set. thanks for any help.
''set intpage to page the user wants
Select Case Request("action")
case 0
intpage = Request("intpage") + 1
if intpage > pageCount then intpage = pageCount
if intpage < 1 then intpage = 1
case else
response.write "<br>correct spot::" & request("action") & "<br>"
intpage = request("action")
End Select
''display the results
If Not rsShw.EOF Then
%><form name=frmShw method=post action="dspmsg.asp">
<input type=hidden name=hid_Shw>
<%
rsShw.AbsolutePage = intpage
For intRecord = 1 To rsShw.PageSize
area = rsShw("area")
recNum = rsShw("record")
topic = rsShw("topic")
%><center><table width=420>
<tr><td width=100 align=left class=first><%=rsShw("mod")%></td><td width=220 class=first align=right><%=rsShw("crtDate")%></td><td width=100 class=first align=right><%=rsShw("replies")%> replies</td></tr>
<tr><td> <a href="prepare.asp?area=<%=area%>&record=<%=recNum%>" class=dspLink><%=topic%></a></td></tr>
</table></center><%
rsShw.MoveNext
If rsShw.EOF Then Exit For
Next
''show the rest of the pages user can see
<input type="hidden" name="intpage" value="<%=intpage%>">
<input type=hidden name=area value="<%=area%>">
<input type="hidden" name="action">
<center><table width=420><tr><td align=center><%
For intRecord = 1 To rsShw.PageCount
******* this is always false if i click a page # link
******* it works if if i click the Next link
if intpage = intRecord then
lnkClass = "dspLinkA"
else
lnkClass = "dspLink"
response.write "<br>in else for rec " & intRecord & ": intpage = " & intpage & "<br>"
end if
%>
****** here is the link that doesn't work ******
<a href="javascript:verify(this,<%=intRecord%>)" class="<%=lnkCLass%>"><%=intRecord%></a>
<%
Next%>
<a href="javascript:verify(this,0)" class=dspLink>Next</a></td>
</tr></table></center>
</form>
''javascript functions
function verify(obj,rec)
{
var recInt;
recInt = parseInt(rec);
document.frmShw.action.value = recInt;
document.frmShw.submit();
}
i'm not sure if it is something in the javascript function, or the way that "action" is set. thanks for any help.