document.forms[0].elements[7].value won't work

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • uNConVeNtiOnAL

    document.forms[0].elements[7].value won't work

    Why doesn't this work - no errors, just no value when text is in textbox

    var fn=document.for ms[0].elements[7].value;

    Thanks

    Tom

  • Randy Webb

    #2
    Re: document.forms[0].elements[7].value won't work

    uNConVeNtiOnAL wrote:[color=blue]
    > Why doesn't this work - no errors, just no value when text is in textbox
    >
    > var fn=document.for ms[0].elements[7].value;[/color]

    Define "doesnt work" and what browser?

    Comment

    • Thomas 'PointedEars' Lahn

      #3
      Re: document.forms[0].elements[7].value won't work

      uNConVeNtiOnAL wrote:[color=blue]
      > Why doesn't this work - no errors, just no value when text is in textbox
      >
      > var fn=document.for ms[0].elements[7].value;[/color]

      <data> I do not have enough information to make a hypothesis. </data>


      PointedEars

      Comment

      • Lee

        #4
        Re: document.forms[0].elements[7].value won't work

        uNConVeNtiOnAL said:[color=blue]
        >
        >Why doesn't this work - no errors, just no value when text is in textbox
        >
        >var fn=document.for ms[0].elements[7].value;[/color]

        You haven't shown us enough information.
        That line will work, if there is a value in a textbox
        which is found at document.forms[0].elements[7].value

        One common error would be to confuse elements[7] with
        the seventh element. It is actually the eighth.

        This demonstrates only one of many reason why it's
        usually better to identify elements by name or id,
        rather than number.

        Comment

        Working...