Drop down selection - Do nothing on certain selctions

Discussion in 'JavaScript' started by ian_ok, Jan 26, 2006.

  1. #1
    I've a drop down menu, but when you selct one of the headings, it takes you off into no where, how can I prevent this.

    My code is:
    <script language="JavaScript">
    <!--
    function MM_jumpMenu(targ,selObj,restore){ //v3.0
      eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
      if (restore) selObj.selectedIndex=0;
    }
    //-->
    </script>
    
    Code (markup):
    and
    
    <form name="alquiler">
    <select name="menu1" onChange="MM_jumpMenu('parent',this,0)">
    <option selected>* Menu *</option>
    <option value="http://www.site2com"></option>
    <option class="dropdown">* [b]DO NOTHING HERE[/b] *</option>
    <option value="http://www.site3com"></option>
    </select>
    <input type="button" name="Button1" value="Go" onClick="MM_jumpMenuGo('menu1','parent',0)">
    </form>
    
    Code (markup):
     
    ian_ok, Jan 26, 2006 IP
  2. dave487

    dave487 Peon

    Messages:
    701
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try value="#"
     
    dave487, Jan 26, 2006 IP