Javascript works in Netscape not in IE!

I am using a simple Javascript code to update a field when the seleccion in a drop-down is changed:

frm=document.forms[0];

i=frm.Location.selectedIndex;

v=frm.Location.options[i].value;

document.forms[0].OfficeCity.value =v

It works in Netscape but not in IE.

Any ideas will be appreciated.

Subject: Javascript works in Netscape not in IE!!

Do the options in your select field have values? (Note – that only occurs in Domino when you use aliases or when you hand-code the field.)

Subject: RE: Javascript works in Netscape not in IE!!

The values in the dialogbox are hard-coded.

Subject: RE: Javascript works in Netscape not in IE!!

No, I mean in the HTML source. When you have a choice list that looks like this:

Choice One

Choice Two

Choice Three

Domino creates this:

If you use aliases:

Choice One|1

Choice Two|2

Choice Three|3

then you get:

Notice that the second group has a value attribute. NS4.x used the option text when a value was unavailable, other browsers (including recent versions of Netscape) will not.

If there is no value attribute in the options in the HTML source, then use .text instead of .value in the “v = field.options[i]” line.

Subject: RE: Javascript works in Netscape not in IE!!

Thank you much! There’s no “value” in the html code. Using the .text instead of .value, now works in both browsers. Thanks again.