+ Reply to Thread
Results 1 to 4 of 4

Thread: Javascript: Navigate from a Drop down menu

  1. #1
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101

    Javascript: Navigate from a Drop down menu

    Introduction:-
    Here I will show you how to go to different websites from a drop down menu

    Let's Begin:-
    Make this code between the HEAD tags:-

    Code:
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    function GotoURL(form){
    var URL = document.form.site.options[document.form.site.selectedIndex].value;
    window.location.href = URL;
    }
    // End -->
    </SCRIPT>
    and make this between the BODY tags:-

    Code:
    <form name="form">
    <select name="site" size=1>
    <option value="">Select where you want to go
    <option value="http://www.time4videos.net.tc">Time4Videos
    <option value="http://www.codecall.net">CodeCall
    </select>
    <input type=button value="Go there" onClick="javascript:GotoURL(this)">
    </form>
    Explanation:-
    Code:
    .......
    <option value="">Select where you want to go
    <option value="http://www.time4videos.net.tc">Time4Videos
    <option value="http://www.codecall.net">CodeCall
    .......
    Include all the URL's here!

    Conclusion:-
    Code is attached, and feedback is welcome!
    Attached Files Attached Files
    Last edited by TcM; 01-06-2007 at 07:02 AM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    xtraze is offline Programming God
    Join Date
    Dec 2006
    Location
    Sri lanka
    Posts
    911
    Rep Power
    0
    You forgot something lol
    </option>
    Fix this ASAP. I don't know but I use </option>. If it's not needed, then ok.

  4. #3
    Join Date
    Aug 2006
    Posts
    11,209
    Blog Entries
    6
    Rep Power
    101
    Quote Originally Posted by xtraze View Post
    You forgot something lol
    </option>
    Fix this ASAP. I don't know but I use </option>. If it's not needed, then ok.

    There is no need of that! Remember less code = less time your page will take to load

  5. #4
    xtraze is offline Programming God
    Join Date
    Dec 2006
    Location
    Sri lanka
    Posts
    911
    Rep Power
    0
    I was using </option> always dude, you may find a toolbar at the top of XTRaze.NET - Preloading images.... which is Edited by me for myself. And I was using </option> there too. I just saw this on another site and made a lot of changes and still going on to make this good for me.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 0
    Last Post: 11-13-2010, 10:58 AM
  2. Drop-Down Menu.
    By Paradox in forum JavaScript Tutorials
    Replies: 7
    Last Post: 06-08-2010, 03:00 PM
  3. grabing value from drop down menu
    By pioneer27 in forum PHP Development
    Replies: 1
    Last Post: 04-21-2009, 03:03 AM
  4. CodeCall Drop Down Menu
    By Whitey in forum JavaScript and CSS
    Replies: 4
    Last Post: 06-17-2008, 01:44 PM
  5. how drop down value will display over the drop down menu
    By anniefs in forum JavaScript and CSS
    Replies: 1
    Last Post: 10-15-2007, 01:09 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts