Link to home
Start Free TrialLog in
Avatar of GaryZ
GaryZ

asked on

JS error on Dialog List Selection

I have the following code for a dialog box, I keep getting an JS error: F0_Num_Locations is undefined.

This code is located in the onLoad command of a frame that contains the field.

var loc = document.forms[0].F0_Num_Locations.options[F0_Num_Locations.selectedIndex].value;
Avatar of HemanthaKumar
HemanthaKumar

whenever you refer an object (say field) in web page, it should be always from parent and ur code will be like this

var loc = document.forms[0].F0_Num_Locations.options[document.forms[0].F0_Num_Locations.selectedIndex].value;

~Hemanth
If the last hint doesn't work, it's because you have the form in a Frame. In this case Notes is loosing the relation to the underlying document.

Check your code in a simple Form first to see if it works.

The hint is : Load/create first the underlying document object first.

ToniA
Avatar of GaryZ

ASKER

ASKER CERTIFIED SOLUTION
Avatar of zvonko
zvonko

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Interesting, that means the corrected formula that I provided din't work for you and the alias of my solution provided by Zvonko worked is it ???
Heman, you proposed: *.value;
I proposed: *.text;

This is not an alias, this a solution <|;-)