By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,287 Members | 1,509 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,287 IT Pros & Developers. It's quick & easy.

Mutlipel fields with same name - getting the value in Netscape

P: n/a
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.field[i].value. However, netscape 4.7 seems to croak.
Why? What is the equivalent way to get the value in netscape 4.7.
Jul 20 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
ma***********@rl.af.mil wrote:
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.field[i].value. However, netscape 4.7 seems to croak.
Why? What is the equivalent way to get the value in netscape 4.7.


<body onload="alert(document.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.test[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 <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* 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
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.