Click to See Complete Forum and Search --> : Javascript menus work great on Safari, not at all on Netscape or IE -- HELP!


registering
07-10-2003, 06:59 PM
Hi all,

I'm just learning javascript and develop on MAC OS X. I've
written code that has been 100% validated and works great on
Safari 1.0, however nothing happens when I view the page
using either IE 5.2 or Netscape 7.1 on MAC OS X, or IE 6.0 on
Windows XP. Basically, when you choose a menu to the left,
the menu to its right should change dynamically, until it's
propogated all the way to the rightmost menu.

The page is here, it's very simple:
http:\\www.mindspring.com/~jc416975/Document.html

I've read-up on browser incompatibilities but couldn't find
anything I'm doing wrong, however it's obviously something.
I've toyed with the code a bit trying a few things but no luck.

Any ideas? Any help is appreciated.

Khalid Ali
07-10-2003, 08:18 PM
It would have been nic if you had mentioned what you expect your page t o do on windows and what is not doing and the errors and some details...looking at your page to me it works..(unless I know what I am looking for)

registering
07-10-2003, 08:43 PM
Basically when you choose the leftmost menu, the menu to
its right should change its pulldown menu options. Then when
you change that menu the one to its right should change. This should continue until you run out of menus. When I view it in any browser except Safari none of the menus change dynamically, they just sit there.

So when you click on "North Carolina" in the first menu, the second menu should then be populated with the options "Masonboro Island" and "Zeke's Island". If you choose one of those, then the third menu should have options such as "YSI-111".

registering
07-11-2003, 08:07 AM
Okay I finally see the area that's causing the problem. Since there is only a single option in the first menu ("North Carolina"), IE and NS don't trigger the onChanged action for the select statement, whereas Safari does. So updateSites() was never being called under IE and NS but is under Safari. Luckily I discovered the alert() function. :)

Unfortunately there could be 1 or multiple options in the pulldown menu, so I'm not sure how to go about fixing it. :( I could artificially add a dummy option but that's really ugly for the user to see everytime they pulldown the menu. Is there an option other than onChange for select? That is, is there a way I can execute updateSites() whenever anyone even highlights any option under the first menu, even if they don't change it?

Thanks for any help.