Although Microsoft have made the [tt]isDisabled[/tt] attribute of DOM Nodes of type [tt]INPUT[/tt] read-only, there is a way to enable or disable a form input dynamically - at least in ie6.
The technique uses textual substitution on the [tt]outerHTML[/tt] attribute of the node in order to lock it. This technique does not work to unlock the cell but, fortunately, it does work on the [tt]innerHTML[/tt] attribute of the parent element.
The following code works for me in ie6.
.
Yours,
fish.
The technique uses textual substitution on the [tt]outerHTML[/tt] attribute of the node in order to lock it. This technique does not work to unlock the cell but, fortunately, it does work on the [tt]innerHTML[/tt] attribute of the parent element.
The following code works for me in ie6.
Code:
<HTML><HEAD>
<script type="text/javascript" language="JavaScript">
function disable(oid) {
var o = document.getElementById( oid );
o.outerHTML = o.outerHTML.replace(
/INPUT/i, 'INPUT disabled ' );
}
function enable(oid) {
var o = document.getElementById( oid );
o.parentElement.innerHTML = o.parentElement.innerHTML.replace(
/\s+disabled\s+(=\s+\S+\s+)?/i, ' ' );
}
</script>
</HEAD><BODY><FORM>
<input id="ID00" type="text" value="00"> <br />
<input type="button" value="disable" onclick="disable('ID00')" />
<input type="button" value="enable" onclick="enable('ID00')" />
</FORM>
</BODY></HTML>
Yours,
fish.