Drop down menu help in html

Thomas

HAIL HYDRA!
  • 5,985
    Posts
    21
    Years
    I am making a pokedex and need help with the drop down menu. I want the page to come up with the user pics a pokemon. How do you do this, or is it even possible? Any help would be appriciative!
     
    I assume you mean a drop-down menu that navigates to a given page when you select an item, like the quick-jump menu at the bottom of the page on PC? It's easy, it just needs a line of Javascript. I can give you the code, but do you have Dreamweaver? It's a lot easier to do it automatically in Dreamweaver.
     
    Yah, I know the code:

    <select>
    <option>write option here</option>
    <option>another option here</option>
    </select>

    Put more options in as you need them
    And please don't double post :P
     
    I have the same problem..I have Html for the world wide web (with xhtml and css) by visual quickstart guide...

    Here i really want it to go to the page when you pick the certian item and then press a submit button....does anyone know what i am saying???
     
    Dude, you got the same book I have. Try here. Search for it. That is my suggestion. The book recommended it anyway :P
     
    I hope this help. If you're talking about this:
    Code:
    <form name="form1">
    <select name="form" onChange="MM_jumpMenu('parent',this,0)">
        <option>Choose thing</option>
        <option>----</option>
        <option value="https://pokecommunity.com">item one</option>
        <option value="https://pokecommunity.com">item two</option>
        <option value="https://pokecommunity.com">item three</option>
    </select>
    </form>
    There that should help :)
     
    Last edited:
    amphros23 said:
    nope i tried it..it didnt work

    anyone else got any idea?
    Worked for me.
    :surprised
     
    The reason it didn't work is that you just copied the body code from Dreamweaver and didn't include the code that defines the function.

    OK, this is the Dreamweaver code for the jump menu.

    First, paste this code between your <head> tags.

    Code:
    <script language="JavaScript" type="text/JavaScript">
    <!--
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
      eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
      if (restore) selObj.selectedIndex=0;
    }
    
    function MM_findObj(n, d) { //v4.01
      var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
        d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
      if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
      for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
      if(!x && d.getElementById) x=d.getElementById(n); return x;
    }
    
    function MM_jumpMenuGo(selName,targ,restore){ //v3.0
      var selObj = MM_findObj(selName); if (selObj) MM_jumpMenu(targ,selObj,restore);
    }
    //-->
    </script>

    That's the Javascript that defines the function.

    Now, where you want to put the menu, paste this code:

    Code:
    <form name="form1">
      <select name="pokedexjumpmenu" onChange="MM_jumpMenu('parent',this,0)">
      <option value="pokedex.php?pokemon=001" selected>001 Bulbasaur</option>
      <option value="pokedex.php?pokemon=002">002 Ivysaur</option>
      <option value="pokedex.php?pokemon=003">003 Venusaur</option>
      </select>
      <input type="button" name="Button1" value="Go" onClick="MM_jumpMenuGo('pokedexjumpmenu','parent',0)">
    </form>

    You'd need to change the links etc though, and add more Pok?mon.
     
    Back
    Top