dcsimg
I have two menu form items being formatted via Javascript and CSS. The 1st menu clicks through to url. The 2nd jump menu won't.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Adam_Bickle
Posted On:   Friday, August 24, 2007 03:35 PM

Hey everybody. I'm having what I believe is a Javascript conflict between two functions. This has caused one of my two forms (a jump menu with CSS formatting) not to function properly. Here is the problem: I have two drop down menu forms. The first has 3 pieces: - a text box for user entry - a drop down to select a location - and submit button The first drop down menu works fine. When you click on the submit button, you are redirected to the results.php page and that works fine. The second form/menu seems to hang. It's a simple jump menu with the some of the same formatting as above. The drop down portion works fine, it just doesn't jump anywhere when you m   More>>

Hey everybody. I'm having what I believe is a Javascript conflict between two functions. This has caused one of my two forms (a jump menu with CSS formatting) not to function properly.


Here is the problem:


I have two drop down menu forms.


The first has 3 pieces:


- a text box for user entry


- a drop down to select a location


- and submit button





The first drop down menu works fine. When you click on the submit button, you are redirected to the results.php page and that works fine.


The second form/menu seems to hang.


It's a simple jump menu with the some of the same formatting as above. The drop down portion works fine, it just doesn't jump anywhere when you make a selection. Note: it also is formatted via the javascript and CSS. And the jump menu works by itself unformatted on it's own.


To make it simpler, I removed all of the extra code and posted the menus on a temporary staging server:


There is a url which has both menus:


http://emeraldmotionwebhosting.com/test-menu/index10.php


Here are the Javascript and CSS files:


http://emeraldmotionwebhosting.com/test-menu/myscripts.js




http://emeraldmotionwebhosting.com/test-menu/stylesheet1.css


you can disregard some of the styles, as they are for other portions not relevant to the menu.


Any help would be greatly appreciated!!


Thanks so much!!

   <<Less

Re: I have two menu form items being formatted via Javascript and CSS. The 1st menu clicks through to url. The 2nd jump menu won't.

Posted By:   Axel_Richter  
Posted On:   Saturday, August 25, 2007 02:49 AM

Hi



ihn your myscripts.js you set all SELECT elements display:none and replace them with UL/LI. The Mouseclick event then is on LI element, not on SELECT/OPTION element. So SELECT.onchange never occurs.



You have to fire SELECT.onchange manually:


...
function setVal(objID, selIndex) {
var obj = document.getElementById(objID);
obj.selectedIndex = selIndex;
obj.onchange();
}
...



greetings



Axel
About | Sitemap | Contact