Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Web Design, HTML And CSS Forums (http://www.go4expert.com/forums/web-design-forum/)
-   -   Jump Menu (http://www.go4expert.com/forums/jump-menu-t130/)

kunoo 20Aug2004 01:37

Jump Menu
 
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 !

shabbir 20Aug2004 07:20

Re: Jump Menu
 
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

kunoo 20Aug2004 11:11

Re: Jump Menu
 
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 !!

shabbir 20Aug2004 11:26

Re: Jump Menu
 
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


All times are GMT +5.5. The time now is 05:50.