www.webdeveloper.com
Results 1 to 3 of 3

Thread: Is it possible to create a normal "a href" link by using a form button?

  1. #1
    Join Date
    Nov 2004
    Posts
    121

    Is it possible to create a normal "a href" link by using a form button?

    How can I use a form button as a link (when the button is clicked the user is taken to another web page)? I have tried many things, so if it is not possible I would be grateful if you could tell me. Otherwise I guess I just have to design my own buttons.

  2. #2
    Join Date
    Jul 2003
    Location
    New York City
    Posts
    2,771
    Code:
    <form action="page.html">
    <div><input type="submit" value="Next Page"></div>
    </form>

  3. #3
    Join Date
    Apr 2003
    Location
    Netherlands
    Posts
    21,654
    <button type="button" onclick="location.href='http://www.site.com';">leave this site</button>
    It would be sensible to wrap the element in an anchor in case JavaScript has been switched off

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