Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    jumping to object (webpage) from select ?

    Hello,

    I am trying to utilize the 2 level select menu found here in this tutorial: http://www.javascriptkit.com/javatut...content2.shtml , except when the object is selected a message pops up on the screen -- and instead I need it to actually take users to an existing website/webpage.

    How would this get changed to do that??? or is there another 2 level select menu that has that already coded that someone could point me to...

    tks.

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    10,965
    Thanks
    0
    Thanked 236 Times in 233 Posts
    Change the option value to the corresponding url.

    Code:
    cities[1]=["New York|http://www.google.com/", "Los Angeles|http://www.yahoo.com", ...
    Then remove the onclick on the cities dropdown and change it to onchange

    Code:
    <select name="cities" size="4" style="width: 150px" onchange="if (this.value) location.href=this.value;">
    If you want it to open in a new window instead of the same window:
    Code:
    <select name="cities" size="4" style="width: 150px" onchange="if (this.value) window.open(this.value, '_blank');">

  • Users who have thanked glenngv for this post:

    cbc58 (11-06-2010)

  • #3
    New to the CF scene
    Join Date
    Nov 2010
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Tks Glenn.


  •  

    Tags for this Thread

    Posting Permissions

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