- From: Curt Arnold <carnold@houston.rr.com>
- Date: Fri, 21 Jun 2002 09:08:53 -0500
- To: www-dom@w3.org
I believe it would be beneficial to add a HTMLFormControl interface to be used as a common ancestor interface for the form control interfaces. This should have no end-user detectable affect from scripting languages since the existing interfaces share identically named attributes. However, it would allow strongly-typed languages to operate on the common attributes of form controls without resorting to reflection. For example, in JavaScript you could do: var controls = form.elements(); for(var i = 0; i < controls.length; i++) { controls.item(i).disabled = true; } But you could not readily do the equivalent in Java. The interface could look something like: interface HTMLFormControl : HTMLElement { readonly attribute HTMLFormElement form; attribute DOMString name; attribute DOMString value; attribute boolean disabled; // // these attributes are not currently in all form control interfaces // attribute DOMString defaultValue; attribute DOMString accessKey; attribute long tabIndex; }
Received on Friday, 21 June 2002 10:09:03 UTC