Mike Shaver wrote:
On 1/11/06, Eugene Lazutkin <[EMAIL PROTECTED]> wrote:
I am not against its use in form elements. It is useful indeed. But it
is handled differently in different browsers mostly because of
deficiency of the standard. That was my warning about.

I believe that you can use the attribute reliably in all browsers, if
you stick to this pattern:

- to disable, add the attribute: elt.setAttribute("disabled", "disabled")

- to re-enable, remove the attribute: elt.removeAttribute("disabled")

I don't know of any browsers that don't support that model, but I will
confess that I haven't tested it explicitly in a while.

It was not so at least a couple years ago --- I was bitten by it once on IE. I don't recall what version it was.

If you look in MSDN reference I gave in my response (http://msdn.microsoft.com/workshop/author/dhtml/reference/properties/disabled_0.asp) you will see that "disabled" is defined as a boolean property. "setAttribute" documentation requires to provide a boolean value for such properties: http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/setattribute.asp.

It doesn't mean that your pattern doesn't work in IE. It means it is not documented for IE => it uses undocumented behavior, which is not reliable.

That is why I think that "disable" is one of the most screwed up attributes. :-)

Thanks,

Eugene

Reply via email to