dropdown box

Discussion in 'HTML' started by rockocubs, Apr 22, 2005.

  1. rockocubs

    rockocubs Guest

    i have a drop down box. When the user makes there selection, i want to
    link to an tag on a web page. I know how to code the href but not sure how
    to tie it two theselection process.

    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    </HEAD>

    <BODY>
    <br>
    Select Table to view:
    <SELECT NAME=maxfiles>
    <OPTION selected>WEA3BAS
    <OPTION>WEA2BAS
    <OPTION>WEA1BAS
    </SELECT>
    </BODY>
    </HTML>
     
    rockocubs, Apr 22, 2005
    #1
    1. Advertising

  2. rockocubs

    Trance Guest

    rockocubs wrote:
    > i have a drop down box. When the user makes there selection, i want to
    > link to an tag on a web page. I know how to code the href but not sure how
    > to tie it two theselection process.
    >
    > <HTML>
    > <HEAD>
    > <TITLE> New Document </TITLE>
    > <META NAME="Generator" CONTENT="EditPlus">
    > <META NAME="Author" CONTENT="">
    > <META NAME="Keywords" CONTENT="">
    > <META NAME="Description" CONTENT="">
    > </HEAD>
    >
    > <BODY>
    > <br>
    > Select Table to view:
    > <SELECT NAME=maxfiles>
    > <OPTION selected>WEA3BAS
    > <OPTION>WEA2BAS
    > <OPTION>WEA1BAS
    > </SELECT>
    > </BODY>
    > </HTML>
    >


    Do you mean a drop down menu? If so there is a nice little tutorial on
    these at Lissa's site; http://www.lissaexplains.com/fun.shtml :)

    Trance.
     
    Trance, Apr 22, 2005
    #2
    1. Advertising

  3. rockocubs

    Toby Inkster Guest

    Trance wrote:

    > Do you mean a drop down menu? If so there is a nice little tutorial on
    > these at Lissa's site; http://www.lissaexplains.com/fun.shtml :)


    That's a stupid menu that won't work without Javascript.

    To answer the OP's question, assuming you have PHP on your server...

    <?
    $choice = $_GET['choice'];
    if ($choice=='WEA3BAS') {
    ?>
    <table><!-- data for WEA3BAS table --></table>
    <? } elseif ($choice=='WEA2BAS') { ?>
    <table><!-- data for WEA2BAS table --></table>
    <? } elseif ($choice=='WEA1BAS') { ?>
    <table><!-- data for WEA1BAS table --></table>
    <? } else { ?>
    <form action="<?=$_SERVER['PHP_SELF']?>" method=get>
    <fieldset>
    <legend>Choice of Table</legend>
    <label>
    Table
    <select name=maxfiles>
    <option selected>WEA3BAS
    <option>WEA2BAS
    <option>WEA1BAS
    </select>
    </label><br>
    <input type="submit" value="View">
    </fieldset>
    </form>
    <? } ?>

    It is not difficult to rewrite this in other languages (Perl, ASP, etc) if
    need be.

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Apr 24, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page