Jump Menu

Light Poster
20Aug2004,01:37   #1
kunoo's Avatar
http://sourcepost.sytes.net/sourcevi...ource_id=16133

In this page only one jump menu is working on click of the go button. But i want all the four shoud work simultaneously. How to do that !
Go4Expert Founder
20Aug2004,07:20   #2
shabbir's Avatar
There are lots of errors in the document source code you have posted. I am mentioning them. First try to correct them and lets see if it does the intended.

1. var strpagename=document.all.frmsearch1.menu1.options document.all.frmsearch1.menu1.selectedIndex].value;
You are fetching the value of menu1. It should be from all the options.

2. You have not mention the onclick event for all the buttons
onclick="Menu_jump('parent',0)"

3 Two buttons have same name but2.

Among all the above errors no2 is most relevant for your unintended behaviour of only one jump menu is working on click of the go button

Thanks
Shabbir Bhimani
Light Poster
20Aug2004,11:11   #3
kunoo's Avatar
http://sourcepost.sytes.net/sourcevi...ource_id=16143

Now i have changed the button name and i am not getting what to do next. Howcan i use the same onclick event for all button ?? Do i have to add one one script for one one menu and put it within one one form ?? Please help me !!
Go4Expert Founder
20Aug2004,11:26   #4
shabbir's Avatar
No same event handler or more specifically same function can be used but you need to pass the menu name as which menu has generated the event. This can be done by changing the function in such a manner as general function to handle the menu options.

Code:
function Menu_jump(targ,menuName){ //v3.0
         var strpagename=menuName.options[menuName.selectedIndex].value;
         if(strpagename!=1)
         {
             eval(targ+".location='"+strpagename+"'");
         }
         else
         {
             alert("Please select section");
             return false;
         }
}
Thanks
Shabbir Bhimani