www.webdeveloper.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 17

Thread: Please help me get this drop down menu

  1. #1
    Join Date
    Sep 2003
    Posts
    59

    Please help me get this drop down menu

    im trying to make this layout that will be very similar to the one on this page

    http://www.neopets.com/guilds/guild....ppiechickie_18

    everything is peachy with the layout ive made except i cant figure out how to get that drop down menu - the problem is the html must be submitted through another site. ive tried codes i have used before and others i found on the net, including javascript, but there are certian blocks on that site that disallow certian codes including javascript. i may be asking for a bit much... but i was hoping i could get some help here. what onClick drop down menu can there be like that that isnt javascript ?

  2. #2
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    The menu used on that page is a simple select with javascript

    Code:
    <form name="linker">
    <select name="links" onchange="document.location=document.linker.links.value;">
    <option>Links</option>
    <option value="http://www.yoursite.com">A Cool Site</option>
    <option value="http://www.othersite.com">Other site</option>
    </select>
    </form>

  3. #3
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    You forgot to name the select box 'links'. And you also forgot to use the SelectedIndex property.

  4. #4
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    Select is named links ?? And It's been a long while since I've used JavaScript so I'm not entirely sure, but it worked for me quite nicely when I tested it.

  5. #5
    Join Date
    Sep 2003
    Posts
    59

    yay

    thanks bob !!

  6. #6
    Join Date
    Sep 2003
    Posts
    59

    GAH

    it worked when i viewed it on explorer but it wont on that site... any other suggestions ? heres where i used it

    http://www.neopets.com/guilds/guild....d=believeguild

  7. #7
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    ERROR:

    Sorry. You are not a member of this guild!

  8. #8
    Join Date
    Sep 2003
    Posts
    59

    oops

    sorry i forgot about that - it should let you look now. i appreciate it

  9. #9
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    Change

    <form>

    to

    <form name="linker">

    The script is looking in the form named "linker" for the object "links" 's value. That should do it.

  10. #10
    Join Date
    Sep 2003
    Posts
    59
    its already like that, heres the html

    <form name="linker">
    <select name="links" onchange="document.location=document.linker.links.value;">
    <option>Links</option>
    <option value="http://www.believeinfaeries.com">Guild Website</option>
    </select>
    </form>

    i think the site is just blocking the script somehow... i probably need to try something else

  11. #11
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    Source code from your site:

    Code:
    <form>
    <select name="links" onchange="document.location=document.linker.links.value;">
    <option>Links</option>
    <option value="http://www.believeinfaeries.com">Guild Website</option>
    </select>
    </form>
    Should Be:

    Code:
    <form name="linker">
    <select name="links" onchange="document.location=document.linker.links.value;">
    <option selected="selected">Links</option>
    <option value="http://www.believeinfaeries.com">Guild Website</option>
    </select>
    </form>
    If the website is blocking the name attribute of form then I can't be of anymore help (with JavaScript).

  12. #12
    Join Date
    Sep 2003
    Posts
    59
    gah

    thats really strange... when you go to enter the html to upload to the site i swear it says

    <form name="linker">

    i tried to save it that way a dozen times, but for some reason when it goes through that oh-so-important segment is left out *sigh*. i guess i am doomed to have a drop-downless layout

  13. #13
    Join Date
    Aug 2003
    Location
    In my house
    Posts
    4,004
    If, for some reason, it isn't working with the form name, this should work:
    Code:
    <form action="#">
    <div><select onchange="window.location=this.options[this.selectedIndex].value;">
    <option value="">..Select..</option>
    <option value="http://www.hotmail.com">Hotmail</option>
    <option value="http://mail.yahoo.com">Yahoo! Mail</option>
    <option value="http://gmail.google.com">Gmail</option>
    </select></div>
    </form>

  14. #14
    Join Date
    Sep 2003
    Posts
    59
    *makes inaudible irritated noises*

    again... works on the explorer but not when i upload it. i wish i could just view the source for the page i got the idea from and figure out how they did it... but for some reason my comp wont let me do it anymore. life would be so much easier ...

  15. #15
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    Code:
    <form>
    <select onchange="if(options[selectedIndex].value){location = options[selectedIndex].value}">
    <option selected="selected">..Guild Links..</option>
    <option value="http://www.believeinfaeries.com">Guild Website</option>
    </select>
    </form>
    That's their method.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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



Recent Articles