Object doesn't support this property or method (IE) OK with FF

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • inxanu
    New Member
    • Feb 2007
    • 9

    Object doesn't support this property or method (IE) OK with FF

    I am getting this error when using IE, however it works fine with FF

    Object doesn't support this property or method

    Any ideas?

    Thanks in advance...

    The problem arises when trying to get the user selection ...The line of code it complains about is the one mark with ==


    function validate () {

    NameElm = document.getEle mentById('Name' );

    ==Name = NameElm.options[NameElm.selecte dIndex].value;==

    ....
    }

    <HTML>
    ...
    <SELECT ID="Name" SIZE="10" onChange="valid ate()">
    <OPTION SELECTED="TRUE" VALUE="-1">-- Please Choose a NAME--</OPTION>
    <?
    set count 1
    foreach name $NameList {

    puts "<OPTION VALUE=\"$name\" >$count - $name</OPTION>"
    incr count
    }
    ?>
    </SELECT>
    ...
    </HTML>
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    Name is an attribute of form elements. Change "name" to something else, even "name1" and it should work.

    Comment

    • inxanu
      New Member
      • Feb 2007
      • 9

      #3
      Hi Acoder,

      Have tried what you suggested, however this does not solve the problem...

      any other ideas?


      function validate () {

      NameElm = document.getEle mentById('Name1 ');

      == MyName = NameElm.options[NameElm.selecte dIndex].value;==
      ....
      }

      <HTML>
      ...
      <SELECT ID="Name1" SIZE="10" onChange="valid ate()">
      <OPTION SELECTED="TRUE" VALUE="-1">-- Please Choose a NAME--</OPTION>
      <?
      set count 1
      foreach noun $NameList {

      puts "<OPTION VALUE=\"$noun\" >$count - $noun</OPTION>"
      incr count
      }
      ?>
      </SELECT>
      ...
      </HTML>

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Have you declared the form tags?

        Comment

        • inxanu
          New Member
          • Feb 2007
          • 9

          #5
          No...I really though I did not need them...it looks like this solves the problem ...will let you know...

          Cheers!

          Comment

          • inxanu
            New Member
            • Feb 2007
            • 9

            #6
            ...it does.. :)

            Many thanks acoder

            Comment

            • acoder
              Recognized Expert MVP
              • Nov 2006
              • 16032

              #7
              You're welcome.

              Comment

              Working...