document.forms[formName].elemName

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas 'PointedEars' Lahn

    #16
    Re: document.forms[formName].elemName

    VK wrote:
    On May 25, 7:01 pm, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
    wrote:
    >The reason for using the standards-compliant approach over the proprietary
    >one is that the latter is the *proprietary* one.
    >
    ???
    Why not read a posting again before protesting, if it is confusing at first?
    forms[index] or forms["formName"] exposes an object with properties
    representing form elements (a.k.a. controls) in the given form.
    Javascript allows to access object property over squared brackets
    notation or over dot notation, other words in object foo with property
    bar, the bar value can be accessed either
    foo["bar"]
    or
    foo.bar
    The latter form is a convenience shortcut of the first one
    No, the proprietary backwards-compatible "convenienc e shortcut" regarding
    the reference to form control objects that we are talking about here is

    document.formna me.elementname
    or
    document.forms["formname"].elementname

    instead of the standards-compliant and also backwards-compatible

    document.forms["formname"].elements["elementnam e"]

    Whether the bracket property accessor is used or not is secondary to this
    difference.
    [...]
    These are basics of the language itself,
    You miss the point.


    PointedEars
    --
    var bugRiddenCrashP ronePieceOfJunk = (
    navigator.userA gent.indexOf('M SIE 5') != -1
    && navigator.userA gent.indexOf('M ac') != -1
    ) // Plone, register_functi on.js:16

    Comment

    • Thomas 'PointedEars' Lahn

      #17
      Re: document.forms[formName].elemName

      Stanimir Stamenkov wrote:
      Sun, 25 May 2008 09:22:41 -0700 (PDT), /VK/:
      >DOM 0,
      >
      This has always been referred to something different vendors have
      once implemented but hasn't been standardized later, either because
      the standard covers the features in a different way (though a way
      the vendors have agreed on), or the features could not be specified
      in way all vendors agree on at the time.
      >
      http://www.w3.org/TR/DOM-Level-2-HTM...dt-DOM-Level-0
      What you and I have cited states that DOM Level 2 HTML specifies features
      that are also found in "DOM Level 0". It is therefore obvious nonsense to
      state that "DOM Level 0" it has not been standardized later; some parts of
      it have been, and HTMLDocument::f orms is one good example of that.

      However, as you have observed, the standards-compliant referencing uses
      specific collections and control names as as their property/item names, not
      only control names, for the referencing.


      PointedEars
      --
      var bugRiddenCrashP ronePieceOfJunk = (
      navigator.userA gent.indexOf('M SIE 5') != -1
      && navigator.userA gent.indexOf('M ac') != -1
      ) // Plone, register_functi on.js:16

      Comment

      • Thomas 'PointedEars' Lahn

        #18
        Re: document.forms[formName].elemName

        VK wrote:
        On May 25, 10:17 pm, Stanimir Stamenkov <s7a...@netscap e.netwrote:
        >If you never read any specification (being standard or not)
        >
        I didn't say that: I said that I never bothered to read W3C specs as I
        see very low practical value in that.
        And therefore you think that you of all people are in a position
        to tell the difference between standards-compliant or proprietary,
        and to make recommendations in that matter.

        You're right. And the moon consists of green cheese. [psf 4.17]


        PointedEars
        --
        var bugRiddenCrashP ronePieceOfJunk = (
        navigator.userA gent.indexOf('M SIE 5') != -1
        && navigator.userA gent.indexOf('M ac') != -1
        ) // Plone, register_functi on.js:16

        Comment

        • Gregor Kofler

          #19
          Re: document.forms[formName].elemName

          Thomas 'PointedEars' Lahn meinte:
          You're right. And the moon consists of green cheese. [psf 4.17]
          I'm not a hundred percent positive about the "green". But "cheese" -
          yes: Wallace and Gromit verified that [1].

          Gregor


          [1]



          --
          http://photo.gregorkofler.at ::: Landschafts- und Reisefotografie
          http://web.gregorkofler.com ::: meine JS-Spielwiese
          http://www.image2d.com ::: Bildagentur für den alpinen Raum

          Comment

          • VK

            #20
            Re: document.forms[formName].elemName

            On May 26, 12:56 am, Thomas 'PointedEars' Lahn <PointedE...@we b.de>
            wrote:
            VK wrote:
            On May 25, 10:17 pm, Stanimir Stamenkov <s7a...@netscap e.netwrote:
            If you never read any specification (being standard or not)
            >
            I didn't say that: I said that I never bothered to read W3C specs as I
            see very low practical value in that.
            >
            And therefore you think that you of all people are in a position
            to tell the difference between standards-compliant or proprietary,
            and to make recommendations in that matter.
            I don't classify things for standards-compliant and proprietary as it
            is mostly useless. I do classify things for i) ones being reliably
            usable on the current set of browsers in consideration (possibly with
            UA-specific workarounds) and for ii) ones not currently being reliably
            usable on the current set of browsers in consideration.

            I assume that "standards-compliant" refers to "being documented at
            w3.org and acting in the way as documented at w3.org".
            You're right. And the moon consists of green cheese.
            If you say so. And say
            var b = document.create Element('BUTTON ');
            b.type = 'button";
            is safe to use on any modern browser with document.create Element
            support because it is "standards-compliant"? Right? Or not right?

            Comment

            • Stanimir Stamenkov

              #21
              Re: document.forms[formName].elemName

              Sun, 25 May 2008 21:50:22 -0700 (PDT), /VK/:
              I don't classify things for standards-compliant and proprietary as it
              is mostly useless. I do classify things for i) ones being reliably
              usable on the current set of browsers in consideration (possibly with
              UA-specific workarounds) and for ii) ones not currently being reliably
              usable on the current set of browsers in consideration.
              >
              I assume that "standards-compliant" refers to "being documented at
              w3.org and acting in the way as documented at w3.org".
              Of course compatibility is the most important goal everyone is
              after. Adhering to standards is the first step in this regard.
              Testing on all target platforms and working around for specific
              one(s) is next. If you're using more non-standardized stuff it is
              more likely you'll get more compatibility problems, initially and in
              future. Don't you agree?
              var b = document.create Element('BUTTON ');
              b.type = 'button";
              is safe to use on any modern browser with document.create Element
              support because it is "standards-compliant"? Right? Or not right?
              Doesn't seem standards-compliant as the 'type' attribute of
              HTMLButtonEleme nt objects is defined to be read-only.

              --
              Stanimir

              Comment

              • Thomas 'PointedEars' Lahn

                #22
                Re: document.forms[formName].elemName

                Gregor Kofler wrote:
                Thomas 'PointedEars' Lahn meinte:
                >You're right. And the moon consists of green cheese. [psf 4.17]
                >
                I'm not a hundred percent positive about the "green". But "cheese" -
                yes: Wallace and Gromit verified that [1].
                D'oh, seems I'll have to update that psf :)


                Regards,

                PointedEars
                --
                var bugRiddenCrashP ronePieceOfJunk = (
                navigator.userA gent.indexOf('M SIE 5') != -1
                && navigator.userA gent.indexOf('M ac') != -1
                ) // Plone, register_functi on.js:16

                Comment

                • Thomas 'PointedEars' Lahn

                  #23
                  Re: document.forms[formName].elemName

                  Stanimir Stamenkov wrote:
                  Sun, 25 May 2008 21:50:22 -0700 (PDT), /VK/:
                  > var b = document.create Element('BUTTON ');
                  > b.type = 'button";
                  >is safe to use on any modern browser with document.create Element
                  >support because it is "standards-compliant"? Right? Or not right?
                  >
                  Doesn't seem standards-compliant as the 'type' attribute of
                  HTMLButtonEleme nt objects is defined to be read-only.
                  One wonders, though, why that is, given that the `type' attribute of HTML
                  4.01/XHTML 1.0 BUTTON/button elements may assume one of three possible values:

                  http://www.w3.org/TR/1999/REC-html40...ml#edef-BUTTON
                  http://www.w3.org/TR/2000/REC-xhtml1...ml1-strict.dtd

                  Seems like an obvious error in the DOM 2 HTML Specification to me.


                  PointedEars
                  --
                  realism: HTML 4.01 Strict
                  evangelism: XHTML 1.0 Strict
                  madness: XHTML 1.1 as application/xhtml+xml
                  -- Bjoern Hoehrmann

                  Comment

                  • Stanimir Stamenkov

                    #24
                    Re: document.forms[formName].elemName

                    Mon, 26 May 2008 10:43:00 +0200, /Thomas 'PointedEars' Lahn/:
                    Stanimir Stamenkov wrote:
                    >
                    >Doesn't seem standards-compliant as the 'type' attribute of
                    >HTMLButtonElem ent objects is defined to be read-only.
                    >
                    One wonders, though, why that is, given that the `type' attribute of HTML
                    4.01/XHTML 1.0 BUTTON/button elements may assume one of three possible values:
                    >
                    http://www.w3.org/TR/1999/REC-html40...ml#edef-BUTTON
                    http://www.w3.org/TR/2000/REC-xhtml1...ml1-strict.dtd
                    >
                    Seems like an obvious error in the DOM 2 HTML Specification to me.
                    The 'type' attribute of HTMLInputElemen t has been read-only in the
                    DOM Level 1 but changed in DOM Level 2. As to why the 'type'
                    attribute of HTMLButtonEleme nt was left read-only in DOM Level 2 I
                    could only speculate it is because that's how it is implemented in
                    Internet Explorer:

                    http://msdn.microsoft.com/en-us/libr...96(VS.85).aspx

                    Seems one could use instead:

                    var btn = document.create Element('button ');
                    btn.setAttribut e('type', 'reset');

                    --
                    Stanimir

                    Comment

                    Working...