Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Focusing on an opend link

Status
Not open for further replies.

Manic

Programmer
Feb 28, 2001
343
GB
Everything is working fine with the code I am just trying to add some bits to it.

I want the user to be focused on the answer they want rater than being taken to the top of the page.

this is the code that I am using

Code:
<table  width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;2&quot; cellpadding=&quot;2&quot; bgcolor=&quot;#ffffff&quot; align=&quot;left&quot; valign=&quot;top&quot;>

<%
strSQLQuery = &quot;SELECT * FROM TechQuestion WHERE QCatID = 1&quot;
Set rs = Server.CreateObject(&quot;ADODB.Recordset&quot;)
rs.activeconnection = objDBConn
rs.Open strSQLQuery
while not rs.eof
strValue1 = rs(&quot;QuestionText&quot;)
strValue2 = rs(&quot;answertext&quot;)
strValue3 = rs(&quot;furtherinfo&quot;)

response.write &quot;<TR><TD valign='top' class='page_text' width=300 bgcolor=#ffffff><img src=/Common/images/faq/q.gif align=left> <A href='list3.asp?techID=&quot; & RS(&quot;TechQuestionID&quot;) & &quot;'>&quot; & strValue1 & &quot;</A></TD><TD width='50'>&nbsp;</TD>&quot;

if trim(request(&quot;techID&quot;)) = trim(rs(&quot;techquestionid&quot;)) then

response.write  &quot;<TD valign='top' class='page_text'><img src=/Common/images/faq/a.gif align=left>&quot; & strValue2

if len (trim(rs(&quot;furtherinfo&quot;))) > 0 then

response.write &quot;<BR><A target='_new' href='&quot; & trim(strValue3) & &quot;'><FONT color='#ff0000'>Click here for more info</font></A></TD>&quot;

else
response.write &quot;</TD>&quot;
end if
end if
response.write &quot;</TR>&quot;
rs.MoveNext
Wend
%>
</table>
-----------------------------
I've broken it again !!
-----------------------------
 
Have you tried this?
On this line use the &quot;#&quot; in the href:
eg:
response.write &quot;<BR><A target='_new' href='&quot; & trim(strValue3) & &quot;'#answer><FONT color='#ff0000'>Click here for more info</font></A></TD>&quot;

and put this line just before the answer where you want the page to focus:

<a name=&quot;answer&quot;>

Hope this help...

Fredy
 
thanks I didn't think about putting that in to the code.

Doh !!!

With a couple of tweeks it worked.

Manic -----------------------------
I've broken it again !!
-----------------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top