Good idea if I wanted to display the message over the hole page, but I think
it is a bit extreme and will be the last choice if nothing else solves this
problem. There must be someway to disable everything without changing the
look of the page.
If youre solution could write out the text but without the href on it i
would be pleased.
Something like this before onclick:
www.google.com www.onjava.com www.javascript.com
and after click , just as above, but then as plain text as if the text was
writen between <td> ...</td> but without the <a href"blabla"> </a>
This javascript does the job, but stop the request which is made when i
click on the link the first time. I would be using onclick to call the
javascript.
function disablehref(){
var input = document.getEle mentsByTagName( "a");
var count = input.length;
for(var i =0; i < count; i++){
document.getEle mentsByTagName( "a")[i].disabled = true;// Does not disable
the link it just gives it a grey color, but works with buttons
document.getEle mentsByTagName( "a")[i].removeAttribut e("href"); //OBS this
works but also stops the request and the next page does not get loaded, just
hangs in the first page
document.getEle mentsByTagName( "a")[i].style.cursor=w ait';// just to give the
mousepointer the wait symbol instead of the hand
}
return true;
}
"Lee" <RE************ **@cox.net> wrote in message
news:bl******** *@drn.newsguy.c om...
KS said:
Any workaround to this? This is a seriuos web app so I want the solution
where i disable ALL links on my page so it is not possible to click on
anyafter the first time.
One approach would to ensure that clicking any link immediately loads
an intermediate page that doesn't have anything to click on.
Here's an example that builds that intermediate page on the fly.
This has the side-effect of not allowing some browsers to go BACK
to the page with the links:
<html>
<head>
<script type="text/javascript">
function disableOtherLin ks(URL){
globalHtml="<ht ml><body>Please Wait<script type=\"text/javascript\">"
+"location=\""+ URL+"\";<\/script></body></html>";
location="javas cript:window.gl obalHtml";
}
</script>
</head>
<body>
<a href="http://www.google.com"
onclick="disabl eOtherLinks('ht tp://www.google.com' );return
false">Google</a> <a href="http://www.yahoo.com"
onclick="disabl eOtherLinks('ht tp://www.yahoo.com') ;return
false">Yahoo</a> </body>
</html>