Results 1 to 6 of 6

Thread: create button pls help

  1. #1
    Join Date
    Jul 2006
    Posts
    27
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default create button pls help

    i have created a button using the code
    <html>
    <body>

    <form>
    <input type="button" value="Hello world!">
    </form>

    </body>
    </html>

    i want to add url to this button ie wen i click this button the download should start ( url window should open ) pls help

  2. #2
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    You should either use:

    <form action="somefile.php">
    <input type="button" value="Hello world!">
    </form>

    Or use javascript:

    <input type="button" value="Hello World!" onclick="doSomething();">

    Hope it helps.

  3. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Code:
    <form action="yourfile.zip" target="_blank">
      <input type="submit" value="Hello world!">
    </form>
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  4. #4
    Join Date
    Aug 2005
    Posts
    971
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I really wish there was something like
    <input type="button" href="somewhere.html" value="Go somewhere!!">

    LOL.

    If it was only allowed to create custom attributes then I would have built one for myself with javascript. If only ....

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    If it was only allowed to create custom attributes then I would have built one for myself with javascript. If only ....
    Not a good idea. Javascript should be avoided wherever a non-Javascript alternative can't be offered, and in this case the Javascript wouldn't actually do anything the alternative couldn't, so there'd be no point in having it
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  6. #6
    Join Date
    Jul 2006
    Posts
    27
    Thanks
    7
    Thanked 0 Times in 0 Posts

    Default

    thank you twey and shachi for your help.

Bookmarks

Posting Permissions

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