Martin Bialasinski wrote: > On 11/1/06, Fred <[EMAIL PROTECTED]> wrote: > > > Incorrect. The forms collection is a formal collection in the W3C DOM > > HTML specification: > > > alert(document.forms[0].docid.value); > > Not quite. HTMLFormElement does not have a "docid" property defined in > the above mentioned specification.
I didn't say it did - please quote properly. If you remove material, indicate where it is removed. I think in this case you removed the link and kept some code that was posted several lines below it. > You have to go through its elements > properties. > > document.forms[0].elements["docid"].value You don't *have* to, browsers will do it for you although there is nothing in any specification that says they must, hence my comment on dot property access. My response was in regard to the assertion that using dot property access would fail, you removed that from the context of the discussion. Using explicit references to collections is generally considered better practice, thank you for including it. > > When using forms, both $() and hence $F() have problems if id and name > > attributes share the same value. > > Only in Internet Explorer and only there is more than one element > involved in this "sharing", no? Yes. "More than one" in that one element has a name that is the same as the id of some other element. "Sharing" implies (rather strongly) more than one. > > Using names for form controls is valid HTML and provides support for > > old browsers. > > The "name" attribute is required for all but submit and reset inputs. According to the W3C specification, the name attribute is *required* for map and param elements only. Other elements use the name attribute for various purposes - e.g. form controls need a name to be successful, applets use a name to communicate, and so on. The W3C HTML specification includes an index of attributes: <URL: http://www.w3.org/TR/html4/index/attributes.html> -- Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs -~----------~----~----~----~------~----~------~--~---
