JS question

Javascript issue… I just don’t understand.I created a simple function that passes in field names, and values ( to check for entries within those field names.)…

The function works fine in one form, but not another. So I thought I break it down to the very basic to troubleshoot:

function EquipListBox ( field_value )

{

var tdoc = document.forms[0];

for (i = 0; i < tdoc.EquipmentType.options.length; i++) {

var eValue = tdoc.EquipmentType.options[i].value;

if ( tdoc.EquipmentType.options[i].value ==  field_value) {

	tdoc.EquipmentType.options[i].selected = true;

	}

}

};

var pdoc = opener.document.forms[0];

var tdoc = document.forms[0];

EquipListBox (pdoc.EquipmentType.value );

Problem is in this very basic loop… the var eValue is always blank or Null.

but the Drop Down list is populated with item values.

The field name is correct and in the correct case.

Please, can anyone advise me here??

thxs,

Brett

Subject: look i’m not crazy

JS worked fine for years…then suddenly in febuary… it stopped. COLD. When I called Lotus on this, the guy made me feel like it was my code (yet it worked for 8 years!), so the basic code for the multivalue field types (drop down list, radio buttons) that they provided, which is everywhere on the net for JS tutorials, worked for 1 month.

Now last friday… THEY FAIL.

anyone please!

Subject: value or text

Hi,

does your options have a value ???

or would you like to compare the text in the Dropdown ??

In this case you have to change .value to .text

Subject: thanks… that works (as it should)… but…

it was a typo on my end… so i made the correction and it works… except when the radio button field has one value in it…Then it will not…

the RB field values are computed based upon the selection of another field.

If Field1 has Salesperson1, put RB field choices as “north” “South”.

If field1 as Salesperson2, put RB field choices as “East”

if Field1 has Salesperson3, put RB Field Choices as “West”, “Canada”.

The RB Field choices change appropriately based upon field1’s value.

When the document is being saved… and values are being passed back to the opener document.

It works dependent on whether is a single choice or not in the RB choice values.

from my perspective, this just doesn’t make sense…

and when you “view source” from web page… the choice / choices are there…