Results 1 to 12 of 12

Thread: Simple HTML Coding Help     submit to reddit submit to twitter

  1. #1
    Campaign
    Join Date
    Aug 2007
    Posts
    6,547
    BG Level
    8

    Simple HTML Coding Help

    .

  2. #2
    Bagel
    Join Date
    Jan 2006
    Posts
    1,428
    BG Level
    6

    What seems to be the problem?

    Works for me (Drop down displays, can select, etc)

  3. #3
    Conejita's Jolly
    Chaparrita's Dulce
    Trigger warning: Fuck your feelings.

    Join Date
    Feb 2006
    Posts
    7,075
    BG Level
    8

    Tested and it works.

    Code:
    SELECT name="URL"onChange="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)"
    Source

  4. #4
    Campaign
    Join Date
    Aug 2007
    Posts
    6,547
    BG Level
    8

    .

  5. #5
    Campaign
    Join Date
    Aug 2007
    Posts
    6,547
    BG Level
    8

    .

  6. #6
    Conejita's Jolly
    Chaparrita's Dulce
    Trigger warning: Fuck your feelings.

    Join Date
    Feb 2006
    Posts
    7,075
    BG Level
    8

    That happens in the source code too. My guess is that if the javascript doesn't stop the action it will take them to the first option as soon as the page loads... all the time. If you notice the first options are conveniently named: choose from the items below, click here, etc.

  7. #7
    Campaign
    Join Date
    Aug 2007
    Posts
    6,547
    BG Level
    8

    .

  8. #8
    Nidhogg
    Join Date
    Oct 2005
    Posts
    3,612
    BG Level
    7
    FFXIV Character
    Glick Wick
    FFXIV Server
    Ultros
    FFXI Server
    Bahamut

    The first option doesn't work because the event is "onChange". If you select the first option while it's already selected, that's not a change!

  9. #9
    Campaign
    Join Date
    Aug 2007
    Posts
    6,547
    BG Level
    8

    .

  10. #10
    Certified Enhancement Shaman
    Join Date
    May 2008
    Posts
    1,871
    BG Level
    6
    FFXIV Character
    Meph Taru
    FFXIV Server
    Diabolos

    whats not working? just did the same and its working fine

    Code:
    <html>
    <body>
    <form>
    <select name="whatever" onChange="if(options[selectedIndex].value) window.location.href=(options[selectedIndex].value)">
    <option value="">pick a option</option>
    <option value="http://www.mmo-champion.com/content/">mmochampion</option>
    <option value="http://www.bluegartr.com/threads/98717-Simple-HTML-Coding-Help">fail at html!</option>
    </select>
    </form>
    </body>
    </html>

  11. #11
    Certified Enhancement Shaman
    Join Date
    May 2008
    Posts
    1,871
    BG Level
    6
    FFXIV Character
    Meph Taru
    FFXIV Server
    Diabolos

    Quote Originally Posted by Pirian View Post
    What I'm seeing basically is that I cannot make it without using javascript, which is bullshit because this is suppose to only be built in html.
    you cant do this with only html since its not dynamic and you would have to set a static [form action="url"] for a form to get posted

  12. #12
    Campaign
    Join Date
    Aug 2007
    Posts
    6,547
    BG Level
    8

    .

Similar Threads

  1. C++ easy code help
    By Skie in forum General Discussion
    Replies: 31
    Last Post: 2009-10-20, 05:10
  2. javascript code help.
    By Bunnykillah in forum General Discussion
    Replies: 3
    Last Post: 2008-11-18, 22:57