Jump Menu

Discussion in 'Web Design, HTML And CSS' started by kunoo, Aug 19, 2004.

  1. kunoo

    kunoo New Member

    Joined:
    Aug 18, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Web Designer
    Location:
    bangalore, India
    Home Page:
    http://www.comfortdesign.biz
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    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
     
  3. kunoo

    kunoo New Member

    Joined:
    Aug 18, 2004
    Messages:
    8
    Likes Received:
    0
    Trophy Points:
    0
    Occupation:
    Web Designer
    Location:
    bangalore, India
    Home Page:
    http://www.comfortdesign.biz
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    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
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice