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