IE name="name" & form.name property bug

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Java  script  Dude

    IE name="name" & form.name property bug

    We just discovered another IE bug.

    When an html form contains an element with a name of `name` IE's
    internal index screws up the .name property of the containing form to
    point to the bad element object instead of containing the string name
    property of the form.

    Here is the simplified test case:

    <html>
    <head>
    <title>IE Name="name" Bug</title>
    <script>
    function showFormName(){
    alert(
    "Text should say `fmTest`~~~> "+
    oF["good_name"].form.name+"\n\ n"+
    "Second test: Test .value prop~~> "+
    oF["good_name"].form.name.valu e
    )
    }
    </script>
    </head>
    <body>
    <form name="fmTest">
    <script>oF=docu ment.forms["fmTest"]</script>
    Good:
    <input type=text name="good_name " value="Good Elem Name">
    <script>showFor mName()</script>
    Bad:
    <input type=text name="name" value="Bad Elem Name">
    <script>showFor mName()</script>
    </form>
    </body>
    </html>

    Probably not a good idea to use just `name` anyway `tbName` or similar
    is better coding practice any how. We are customizing a system that
    uses form element names that match attribute names in our business
    object server. `name` is actually the core business object `name`
    attribute. We are working around by customizing the TCL core code to
    look for obj_name instead.

    JsD
  • Richard Cornford

    #2
    Re: IE name=&quot;name &quot; &amp; form.name property bug

    Java script Dude wrote:[color=blue]
    > We just discovered another IE bug.[/color]

    It isn't necessarily a bug and it certainly isn't restricted to IE.
    [color=blue]
    > When an html form contains an element with a name of `name` IE's
    > internal index screws up the .name property of the containing form to
    > point to the bad element object instead of containing the string name
    > property of the form.[/color]
    <snip>

    "The Most Common Mistake":-

    <URL: http://jibbering.com/faq_notes/form_....html#faComMis >

    Richard.


    Comment

    • Randy Webb

      #3
      Re: IE name=&quot;name &quot; &amp; form.name property bug

      Richard Cornford wrote:

      <snip>[color=blue]
      >
      > "The Most Common Mistake":-
      >
      > <URL: http://jibbering.com/faq_notes/form_....html#faComMis >
      >[/color]

      HTTP/1.1 404 Object Not Found


      --
      Randy
      Chance Favors The Prepared Mind
      comp.lang.javas cript FAQ - http://jibbering.com/faq/

      Comment

      • Andrew Urquhart

        #4
        Re: IE name=&quot;name &quot; &amp; form.name property bug

        *Randy Webb* wrote:[color=blue]
        > *Richard Cornford* wrote:[color=green]
        >> "The Most Common Mistake":-
        >> <URL: http://jibbering.com/faq_notes/form_....html#faComMis >[/color]
        >
        > HTTP/1.1 404 Object Not Found[/color]


        --
        Andrew Urquhart
        - FAQ: www.jibbering.com/faq/
        - Archive: www.google.com/groups?q=comp.lang.javascript
        - My reply address is invalid, see www.andrewu.co.uk/contact/


        Comment

        • Randy Webb

          #5
          Re: IE name=&quot;name &quot; &amp; form.name property bug

          Andrew Urquhart wrote:
          [color=blue]
          > *Randy Webb* wrote:
          >[color=green]
          >>*Richard Cornford* wrote:
          >>[color=darkred]
          >>>"The Most Common Mistake":-
          >>><URL: http://jibbering.com/faq_notes/form_....html#faComMis >[/color]
          >>
          >>HTTP/1.1 404 Object Not Found[/color]
          >
          >
          > http://www.jibbering.com/faq/faq_not....html#faComMis[/color]

          Thanks, I knew it was in there somewhere :)

          --
          Randy
          Chance Favors The Prepared Mind
          comp.lang.javas cript FAQ - http://jibbering.com/faq/

          Comment

          • Richard Cornford

            #6
            Re: IE name=&quot;name &quot; &amp; form.name property bug

            Randy Webb wrote:[color=blue]
            > Andrew Urquhart wrote:[/color]
            <snip>[color=blue][color=green]
            >> http://www.jibbering.com/faq/faq_not....html#faComMis[/color]
            >
            > Thanks, I knew it was in there somewhere :)[/color]

            Sorry, it had just occurred to me that I forgot the /faq and I was about
            to post a correction. I won't bother now.

            Ricahrd.


            Comment

            • Java  script  Dude

              #7
              Re: IE name=&quot;name &quot; &amp; form.name property bug

              > >> http://www.jibbering.com/faq/faq_not....html#faComMis

              Thanks Richard,

              I'll be sure to check the FAQ before any more similar posts.

              Tim

              Comment

              Working...