Axel Richter: Umkehrfunktion für "disable"?

Beitrag lesen

Hallo,

Man gucke aufs Thema, aha, Javascript. Und das Attribut "disabled" eines Formularfeldes ist in JavaScript ein Boolean, der entweder mit True (=Disabled) oder false (=Enabled) gefüllt ist.

Ja. Da habe ich mich wohl von irgendeinem früheren Problem beirren lassen. Eventuell gab es da mal einen JavaScript-Bug in einem Browser, für den das Notieren von [element].disabled='disabled' statt [element].disabled=true die Lösung war. Jedenfalls ist [element].disabled=true und [element].disabled=false richtig, weil:

http://www.w3.org/TR/1998/WD-DOM-19980720/level-one-html.html

Interface HTMLInputElement
Form control. Note. Depending upon the environment the page is being viewed, the value property may be read-only for the file upload input type. For the "password" input type, the actual value returned may be masked to prevent unauthorized use. See the INPUT element definition in HTML 4.0.

IDL Definition
interface HTMLInputElement : HTMLElement {
           attribute  wstring              defaultValue;
           attribute  boolean              defaultChecked;
  readonly attribute  HTMLFormElement      form;
           attribute  wstring              accept;
           attribute  wstring              accessKey;
           attribute  wstring              align;
           attribute  wstring              alt;
           attribute  boolean              checked;
           attribute  boolean              disabled;
           attribute  long                 maxLength;
           attribute  wstring              name;
           attribute  boolean              readOnly;
           attribute  wstring              size;
           attribute  wstring              src;
           attribute  long                 tabIndex;
  readonly attribute  wstring              type;
           attribute  wstring              useMap;
           attribute  wstring              value;
  void                      blur();
  void                      focus();
  void                      select();
  void                      click();
};

Da hast Du also Recht.

Denn wenn du mir jetzt erzählen willst, dass man in eine Datei mit dem DocType HTML 4.01 ein disabled="disabled" reinschreiben sollte, dann lach ich mich schlapp :o)

Doch, das will ich Dir auch jetzt noch erzählen. Das ist valides HTML4.01.

viele Grüße

Axel