Web Analytics Made Easy -
StatCounter element references & forms? - CodingForum

Announcement

Collapse
No announcement yet.

element references & forms?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • element references & forms?

    Should document.form.name.element.name apply only to the form.elements collection?

    For example, which reference should be used for an <object> in a form:

    document.form.name.object.name -or- document.getElementById(object.id)

    or does it matter?
    hmm... ?

  • #2
    document.forms[formname].elements[elementnameorid] should work for all form controls, including object elements whose declare attribute is not set. I'm not sure you can rely on browsers when it comes to this, however, so it's safer to use document.getElementById(objectid)
    liorean <[[email protected]]>
    Articles: RegEx evolt wsabstract , Named Arguments
    Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
    Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

    Comment


    • #3
      Sounds good; thanks for the information.
      hmm... ?

      Comment

      Working...
      X