Re-create a drop-down menu

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vic Spainhower

    Re-create a drop-down menu

    I have 2 drop-down menus (1) States (2) Shows By State. My question is how
    do I invoke a re-build of the Shows By State drop-down when the user
    requests a different state. I believe this has to be done with Javascript
    and I don't know Javascript. Could someone supply a small example of how
    this is done?

    I am using PHP and MySQL. Following is the PHP code for building the state
    drop-down menu:

    <tr><td bgcolor="#EFC89 1" width="496" align="left"><b >Select a Show in Your
    State:&nbsp;&nb sp;

    <select name="ShowState " >
    <?php
    $stateName=getS tateName();
    $stateCode=getS tateCode();
    for ($n=1;$n<=50;$n ++)
    {
    $state=$stateNa me[$n];
    $scode=$stateCo de[$n];
    echo "<option value='$scode'" ;
    if ($scode== $searchState)
    echo " selected";
    echo ">$state\n" ;
    }
    ?>
    </select>

    Thanks,

    Vic


  • Andy Hassall

    #2
    Re: Re-create a drop-down menu

    On Wed, 5 Oct 2005 13:39:32 -0700, "Vic Spainhower" <vic@showsec.co m> wrote:
    [color=blue]
    >I have 2 drop-down menus (1) States (2) Shows By State. My question is how
    >do I invoke a re-build of the Shows By State drop-down when the user
    >requests a different state. I believe this has to be done with Javascript
    >and I don't know Javascript. Could someone supply a small example of how
    >this is done?[/color]

    The HTML_QuickForm class on PEAR has an element for this:



    Using QuickForm also gets you a lot more form building and validation
    functionality as well, although this may not be quite the answer you're looking
    for.
    --
    Andy Hassall :: andy@andyh.co.u k :: http://www.andyh.co.uk
    http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool

    Comment

    Working...