Drop Down Menu Help

Discussion in 'PHP' started by sebthib55, Sep 4, 2007.

  1. #1
    I made a drop down menu in a search feature. The search feature works great, except I wanted to add an extra feature to it...

    What I want is if a user selects GAME in the drop down, I wish to make a new drop down menu appear displaying categories... How can I do this? I've googled, but received no answer.

    Thanks...

    
    <?PHP
    
    
    echo"<form action='' method='get'>
    Term: <input type='text' value='' name='search' /> <br /><br />
    Search by: <br /><select size='1' name='by'>
    <option value='game'>Game</option>
    <option  value='item'>Item</option>
    <option value='name'>User</option>
    <option  value='usershop'>Usershop</option></select>";
    
    
    //If User Selects GAME display Categories below
    echo"<br />In Category: <select size='1' name='searchcat'>
    <option value='All' selected='selected'>All</option>";
    $catquery=run_query("SELECT * FROM phpqa_cats");
    while ($catlist= mysql_fetch_array($catquery)) echo  "<option value='$catlist[0]'>$catlist[1]</option>";
    //End Display Categories
    ?>
    
    </select><br /><br />
    <input type='submit' value='search' name='action' />
    <br /><br />
    </form>
    
    
    PHP:
     
    sebthib55, Sep 4, 2007 IP
  2. rederick

    rederick Peon

    Messages:
    128
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Your probably looking for a Dynamic Select box ?

    Either that or look into using JQuery or prototype to create the second select box using some ajax calls.
     
    rederick, Sep 4, 2007 IP