Microsoft KB Archive/253579

From BetaArchive Wiki
Knowledge Base

Article ID: 253579

Article Last Modified on 5/11/2006


  • Microsoft Internet Explorer 4.0 128-Bit Edition
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Internet Explorer 4.01 Service Pack 1
  • Microsoft Internet Explorer 4.01 Service Pack 2
  • Microsoft Internet Explorer 5.0
  • Microsoft Internet Explorer 5.01
  • Microsoft Internet Explorer 5.5

This article was previously published under Q253579


Although the DISABLED attribute is set to true for a hyperlink, as in the following,

<a DISABLED="true" href="">Where do you want to go today?</a>

users can still click on the hyperlink and Internet Explorer navigates to the selected page.


To resolve this problem, set an onclick event for the hyperlink that returns either true or false depending on the current execution context. The following code sets the value of a global Microsoft JScript variable to true or false, depending on a button click. The target hyperlink object's DISABLED property is updated so that it can properly communicate its disabled status to other objects and script functions on the page.


<title>Workaround for DISABLED Attribute Problem</title>


var canNav = false;

function canNavigate() {
    return canNav;

function load() {
    document.all("btn1").innerText = "Link status == " + canNav;

function setNavigate(linkObj, canNavParam) {
    if (linkObj != null) {
        if (canNavParam == false) {
            linkObj.disabled = true;
        } else {
            linkObj.disabled = false;
        canNav = canNavParam;

function updateBtnStatus(btnName) {
    var btn = document.all(btnName);
    if (btn != null) {
        document.all(btnName).innerText = "Link status == " + canNav;



<body onload="load();">

<a id="lnk1" disabled=true href="" onclick="return canNavigate();">Click  here</a><p>

<button id=btn1 onclick="setNavigate(document.all('lnk1'), !(canNav));updateBtnStatus('btn1');">




Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.


For more information about developing Web-based solutions for Microsoft Internet Explorer, visit the following Microsoft Web sites:

(c) Microsoft Corporation 2000, All Rights Reserved. Contributions by Jay Andrew Allen, Microsoft Corporation.

Keywords: kbbug kbdhtml kbpending KB253579