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

disable links

Status
Not open for further replies.

mackey333

Technical User
May 10, 2001
563
US
hey everyone...i've got another prob...

on my site, every time you click a link it records the target, date, and time to cookies...now if there happens to be a 404 error, these cookies will be used to fillout and submit a hidden form, then new cookies will be saved telling the site the the target isn't found, i can then locate the non-working link by checking the targets of the links on the page, now the prob is once i find the link, i can't figure out how to disable/turn it off (not just change the target to javascript:void(0) or somethin..i mean leave the text and remove the accual <a href>...is there any way to do this without using javascript to write the navigation bar?

flaga.gif
-Greg :-Q
 
Here is a modified version of a file I had sitting around. I know this isn't exactly what you want to do, but maybe it will be somewhat helpful...

Code:
<html>
<head>
<title>Remove comma test</title>
<script language=&quot;javascript&quot;>
function removeit() {
if (document.forms[0].text1.value.indexOf(&quot;<a href&quot;) != -1) {
var reg = new RegExp(&quot;<a href=\&quot;.{1,40}\&quot;>&quot;)
document.forms[0].text1.value = document.forms[0].text1.value.replace(reg,&quot;&quot;)

if (document.forms[0].text1.value.indexOf(&quot;</a>&quot;) != -1) {
var reg2 = new RegExp(&quot;</a>&quot;)
document.forms[0].text1.value = document.forms[0].text1.value.replace(reg2,&quot; &quot;)

removeit()
}
}
}
</script>
</head>
<body>
<form>
<input type=&quot;text&quot; name=&quot;text1&quot; />
<input type=&quot;button&quot; onclick=&quot;removeit()&quot; value=&quot;GO&quot; />
</form>
</body>
</html>
 
I guess I should explain it a little...

Just enter any link (<a href=&quot;whatever.html&quot;>text</a>) in the textbox and click the button. It will remove everything but the text between the <a> and </a> tags.

 
thanks for the reply, but that won't work for me...that is searching a text string, i need to modify the accual html of my page -Greg :-Q

flaga.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top