Re: Disable the links on the web page...

by "Darrell King" <darrell(at)webctr.com>

 Date:  Mon, 22 Apr 2002 15:53:52 -0400
 To:  <hwg-basics(at)hwg.org>
 References:  nrc
  todo: View Thread, Original
So make a function that returns false if the target link is clicked.
Assuming I understand correctly, you want one link to turn off all other
links on the page.  However, if you are saying that you have multiple links
and each should turn all others off, then configure them all like the Toggle
Link below.

Does it need to be said that this requires staying on the same page?  Once
they click asway, state is lost unless you send the LinkFlag variable in a
query string or something.

D

....................................
<.html>
<.head>
<.title> JavaScript Test Document <./title>

<.script type='text/javascript'>
var LinkFlag = true;

function toggleLinks(state)
{
  if (state) LinkFlag=false;
  return LinkFlag;
}
<./script>

<./head>

<.body>
<.p><.a href='#' title='Toggle Link' onClick="return
toggleLinks('off')">Toggle Link<./a><./p>

<.a href='http://hwg.org' title='Test Link' onClick='return
toggleLinks()'>Test Link<./a><.br />
<.a href='http://netsol.org' title='Test Link' onClick='return
toggleLinks()'>Test Link<./a>

<./body>
<./html>
..............................

----- Original Message -----
From: "Martin Clifford" <MLC1(at)nrc.gov>
...


That works, but not with their requirements.  They wanted it so that if you
click a link, all other links become disabled immediately (so that you
cannot change your mind or something, I have no idea what it would
accomplish).  By your example, it would have to be hardcoded with the link
disabled, thus defeating the purpose of having the hyperlink there in the
first place.

Martin

HTML: hwg-basics mailing list archives, maintained by Webmasters @ IWA