WEB Need quick help writing code

Discussion in 'OT Technology' started by daballer2005, Sep 30, 2007.

  1. daballer2005

    daballer2005 New Member

    Joined:
    Mar 15, 2007
    Messages:
    9,525
    Likes Received:
    0
    Location:
    816 up in this bitch
    Ok, im a noob when it comes to this but i got stuck here and need soem help. After people click the button, i wnat them to be sent to a file(random.wmv) then have another site open in another window. I dont even know if this is possible:wtc: But here is where i got stuck
    Code:
     <form method="LINK" action="http://random.com/asdf.wmv"> "http://yahoo.com" target="_new">
    <input value="yahooooo" type="submit"></form><p>
    
    help plz
     
  2. babygodzilla

    babygodzilla I love rice

    Joined:
    Nov 5, 2001
    Messages:
    3,108
    Likes Received:
    0
    what? why is there an "http://yahoo.com" target="_new" after you close the <form> tag? did you forget to erase something?


    you could do this as well:

    Code:
    
    <form>
    <input type="button" value="Click Me!" onClick="parent.location='http://random.com/asdf.wmv';"/>
    </form>
    
    although i would usually avoid inline Javascript if possible.
     
  3. daballer2005

    daballer2005 New Member

    Joined:
    Mar 15, 2007
    Messages:
    9,525
    Likes Received:
    0
    Location:
    816 up in this bitch
    when they click it, i want them the DL to pop up, then have a new window open to another site
     
  4. babygodzilla

    babygodzilla I love rice

    Joined:
    Nov 5, 2001
    Messages:
    3,108
    Likes Received:
    0
    so... you want a button link that goes to TWO different URLs?
     
  5. daballer2005

    daballer2005 New Member

    Joined:
    Mar 15, 2007
    Messages:
    9,525
    Likes Received:
    0
    Location:
    816 up in this bitch
    yes, not possible?
     
  6. babygodzilla

    babygodzilla I love rice

    Joined:
    Nov 5, 2001
    Messages:
    3,108
    Likes Received:
    0
    not with regular HTML it's not. i hope you're not opposed to Javascript.

    Code:
    <script type="text/javascript">
    
    function openLinks(url1, url2) {
    
    window.open(url1);
    window.open(url2);
    }
    
    </script>
    
    <form method="LINK" action="" onSubmit="openLinks('yahoo.com', 'google.com');">
    <input type="submit" value="click me">
    </form>
    
    
    that looks like it should work. didnt test it so sorry if it doesnt, but it's pretty close i think.

    note that window.open() has many many optional parameters. consult the following link to see the details: http://developer.mozilla.org/en/docs/DOM:window.open


    edit: ok it worked, just tested it. successfully opened 2 new tabs for me.
     
  7. daballer2005

    daballer2005 New Member

    Joined:
    Mar 15, 2007
    Messages:
    9,525
    Likes Received:
    0
    Location:
    816 up in this bitch
    :bowdown:

    I love you bro, wanna program a page for me? $200
     

Share This Page