Mutlipel fields with same name - getting the value in Netscape

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mark.reichman@rl.af.mil

    Mutlipel fields with same name - getting the value in Netscape

    I have text fields in my form with the same name. I can reference the
    value of these fields in IE 6.0 like with
    document.form.f ield[i].value. However, netscape 4.7 seems to croak.
    Why? What is the equivalent way to get the value in netscape 4.7.
  • Grant Wagner

    #2
    Re: Mutlipel fields with same name - getting the value in Netscape

    mark.reichman@r l.af.mil wrote:
    [color=blue]
    > I have text fields in my form with the same name. I can reference the
    > value of these fields in IE 6.0 like with
    > document.form.f ield[i].value. However, netscape 4.7 seems to croak.
    > Why? What is the equivalent way to get the value in netscape 4.7.[/color]

    <body onload="alert(d ocument.forms['myForm'].test[1].value);">
    <form name="myForm">
    <input type="text" name="test" value="1">
    <input type="text" name="test" value="2">
    </form>

    Works fine in both Netscape 4.78 and Mozilla 1.5a.

    As does document.myForm .test[1].value; and
    document.forms['myForm'].elements['test'][1].value.

    What doesn't work is: alert(myForm.te st[1].value); since Netscape doesn't
    not maintain a list of global references to forms and form elements in the
    document like IE does.

    --
    | Grant Wagner <gwagner@agrico reunited.com>

    * Client-side Javascript and Netscape 4 DOM Reference available at:
    *


    * Internet Explorer DOM Reference available at:
    *
    Gain technical skills through documentation and training, earn certifications and connect with the community


    * Netscape 6/7 DOM Reference available at:
    * http://www.mozilla.org/docs/dom/domref/
    * Tips for upgrading JavaScript for Netscape 6/7 and Mozilla
    * http://www.mozilla.org/docs/web-deve...upgrade_2.html


    Comment

    Working...