Creating a listbox of Hyperlinks?

Discussion in 'HTML & Website Design' started by Captain_Ambiguous, May 19, 2011.

  1. #1
    I'm working on an office map tool for my company. Basically it will have a list of people and when you click on one some javascript executes to change the main display picture to a map of that person's location. I have the script that does that part but there's a practical issue in terms of having several hundred hyperlinks on the side of the page :p

    A listbox came to mind, basically a fixed pane where people could scroll through the names and select one. I've never done that before and even if I create the listbox I don't know if it will be able to execute the hyperlink code properly. Here's the link code (there will be one for every employee):

    <a id="two" href="#" onclick="changeIt('image2');">George Bush</a>

    An actual listbox might not be the way to go but something similar to one definately. Can anyone point me in the right direction? Thanks.
     
    Captain_Ambiguous, May 19, 2011 IP
  2. Guru_101

    Guru_101 Member

    Messages:
    51
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    43
    #2
    Is this what you want?

    <form method="post" action="http://site.com/jump.php"><br />
    <select name="url"><br />
    <option value="http://site.com/currentpage">Please select an item:</option><br />
    <option value="http://site.com">Home</option><br />
    <option value="http://site.com/about">About</option><br />
    <option value="http://site.com/contact">Contact</option><br />
    <option value="http://site.com/sitemap>Sitemap</option><br />
    </select><br />
    <label><br />
    <input value="Go!" type="submit" /><br />
    </label><br />
    </form>
    Code (markup):
     
    Guru_101, May 19, 2011 IP
  3. Captain_Ambiguous

    Captain_Ambiguous Active Member

    Messages:
    66
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    95
    #3
    The Go button doesn't appear when I plug that script in. I've tried a few ready-made scripts that work fine until I blank the link value and add the "onclick=" part. The editor doesn't reject it but nothing happens when I try to use it on the page. There must be another way to incorporate that "changeIt" function into a list.
     
    Captain_Ambiguous, May 19, 2011 IP