[thelist] DOM Help p l e a s e

.jeff jeff at members.evolt.org
Mon Jul 15 22:25:01 CDT 2002


timothy,

><><><><><><><><><><><><><><><><><><><><><><><><><><><><><
> From: Timothy Martens
>
> Is there anyway to make the link.text inactive after
> the user responds to a prompt or alert?
><><><><><><><><><><><><><><><><><><><><><><><><><><><><><

if you just want to disable the link then you could use several approaches
depending on what cross-section of js-enabled browsers you need to support.

if you're just targeting dom browsers, look in to the disabled property.
depending on the browser you can set this property's value on most anything,
links included.

<a
 href="somedoc.html"
 onclick="if(confirm('foo'))
   {
     this.disabled = true;
     return true;
   }
   return false;"
>some doc</a>

if you want to cover more browsers than that, you could try altering a
variable value and only allowing the link to work if the variable has a
certain value.

<script language="JavaScript" type="text/javascript">
<!--
  var somedocConfirmed = false;
//-->
</script>

<a
 href="somedoc.html"
 onclick="if(!somedocConfirmed && confirm('foo'))
   {
     somedocConfirmed = true;
     return true;
   }
   return false;"
>some doc</a>

good luck,

.jeff

http://evolt.org/
jeff at members.evolt.org
http://members.evolt.org/jeff/






More information about the thelist mailing list