Need a bit of help with Drop Down Lists

Discussion in 'HTML & Website Design' started by fadetoblack22, Nov 10, 2008.

  1. #1
    I have some drop down list tests I am playing with here:

    http://www.my-plague.net/list.php

    There are a few thing I need help with:

    1) If I don't put a "select" url, if go is clicked on I get a server error. I just want it to do nothing. e.g. with the header.

    2) If I put a style for a "select" that has no url, then the list reverts to a square more box-like shape.

    3) I want to make the go button open the urls in a new window.

    4) I don't know what the js code at the end does because it still works without it (found the code in a tutorial) :

    <script language="JavaScript">
    <!--
    function gotoLink(form) {
       var OptionIndex=form.ListBoxURL.selectedIndex;
       parent.location = form.ListBoxURL.options[OptionIndex].value;}
    //-->
    </script>
    
    Code (markup):
    thanks.
     
    fadetoblack22, Nov 10, 2008 IP
  2. fadetoblack22

    fadetoblack22 Well-Known Member

    Messages:
    2,399
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    160
    #2
    No one can help with this?
     
    fadetoblack22, Nov 11, 2008 IP
  3. rlhanson

    rlhanson Peon

    Messages:
    25
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Can you put the url as "http://whateverthedomain.com/#" to have it do nothing and put "http://whateverthedomain.com/url.html" target="_blank" to have it open a new page?

    I may not be understanding exactly what you are trying to achieve - if you can give me the reasoning behind it I may be able to help you figure something out. :)
     
    rlhanson, Nov 11, 2008 IP
  4. fadetoblack22

    fadetoblack22 Well-Known Member

    Messages:
    2,399
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    160
    #4
    Thanks for the reply.

    I can't put the domain of the page it is on for it to do nothing because it reloads the page when I press go plus when I get the new window working it will open it in a new window as well.

    I can't use target="_blank" because it is not an "a href" url
     
    fadetoblack22, Nov 11, 2008 IP
  5. fadetoblack22

    fadetoblack22 Well-Known Member

    Messages:
    2,399
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    160
    #5
    I solved number 1) by changing "option selected" to "option value" for the header.

    any help with the other problems?
     
    fadetoblack22, Nov 11, 2008 IP
  6. rlhanson

    rlhanson Peon

    Messages:
    25
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
  7. fadetoblack22

    fadetoblack22 Well-Known Member

    Messages:
    2,399
    Likes Received:
    62
    Best Answers:
    0
    Trophy Points:
    160
    #7
    fadetoblack22, Nov 12, 2008 IP