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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to disable hyperlinks 1

Status
Not open for further replies.

Boyeditor

Programmer
Apr 23, 2002
9
0
0
NO
I have a small, and maybe a silly question, but is it possible when generating an asp page from a access database to make the page disable the hyperlinks that is stored in the database?

I have a pda page and i'm trying to find a script that will disable all generated hyperlinks so when the text comes up there will be no clickable links. Get it?

Sorry for my bad english..
 
how are they stored?

with http:// ?
or what "Never underestimate the power of determination"

Stuart
 
The links are stored like a link.

Like this: <a href=&quot;link.htm&quot;>Link</a>

I want to remove <a href=&quot;link&quot;> and </a>

Can you help Schase?
 
Ok well I had to get a little help on this by our good friends over at aspmessageboard.com.


But we can do this.

<%
link = Recordset1.fields.item(&quot;fldLink&quot;).value

link = right(link,len(link)-instr(link,&quot;&quot;&quot;&quot;))
link = left(link,instr(link,&quot;&quot;&quot;&quot;)-1)
%>
<%=link%>

That will return link.htm

So we simply add to it a little more

<%
link = Recordset1.fields.item(&quot;fldLink&quot;).value

link = right(link,len(link)-instr(link,&quot;&quot;&quot;&quot;))
link = left(link,instr(link,&quot;&quot;&quot;&quot;)-1)
link = replace(link,&quot;.htm&quot;,&quot;&quot;)
Link = replace(link,&quot;.html&quot;,&quot;&quot;)
Link = replace(link,&quot;.asp&quot;,&quot;&quot;)
%>
<%=link%>

Which bingo will replace 3 different extensions into just the name.

Out of curiosity - why not just store the filename? like
link.htm?

It would make it so much easier - and its no problem on pulling the links back out. &quot;Never underestimate the power of determination&quot;

Stuart
 
btw - where normally you have the info displayed like
<%=recordset1.fields.item(&quot;fldLink&quot;).Value%>

replace that with the above code (the second version) &quot;Never underestimate the power of determination&quot;

Stuart
 
Well Stuart nice bit of code.

I looked at the question and knew something like that would work but didnt have the time to figure it all out.

Cheech [Peace][Pipe]
The secret of life is honesty and fair dealing. If you can fake that, you've got it made.
Groucho Marx (1895-1977)
 
lol me neither.

I knew the standard replace like my last few lines. But for a range - ugggh. &quot;Never underestimate the power of determination&quot;

Stuart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top