34 users online (0 members and 34 guests)  


  Results 1 to 2 of 2
  1. #1
    shubala's Avatar
    New User

    Status
    Offline
    Join Date
    Jul 2001
    Location
    as
    Posts
    1

    Exclamation Please help......

    OK i want to make a site where i will have a drop down menu. It's made with the form tag. I want it to be able to do the following:

    When someone let's say clicks on the menu and it drops down and he/she clicks on let's say "Games", then I want it to be able to transfer the person the the Games page. I dont want to click on a "GO" button or anything. is there any way u can just choose the page u want to go to and then it automatically gets u there. Please tell me the code.

    Thanks!

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Post

    Hello and welcome to the help desk!
    A simple javascript can give you what you want. Here is the code as wriitin by Alex Tu of http://www.geocities.com/MadisonAvenue/4368

    ---put this in the <head> of your file---
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function formHandler(form){
    var URL = document.form.site.options[document.form.site.selectedIndex].value;
    window.location.href = URL;
    }
    // End -->
    </SCRIPT>
    ----------------------
    ---put this in the <body> of your file---
    <form name="form">
    <select name="site" size=1 onChange="javascript:formHandler()">
    <option value="">Go to....
    <option value="http://www.yahoo.com">Yahoo
    <option value="http://www.metacrawler.com">Metacrawler
    <option value="http://www.altavista.digital.com">Altavista
    <option value="http://www.webcrawler.com">Webcrawler
    <option value="http://www.lycos.com">Lycos
    <option value="http://ahfb2000.com">Advanced HTML For Beginners</select>
    </form>

    good luck,

    Dave