Making html button behave like hyperlink

Discussion in 'HTML' started by WJ, Jan 19, 2006.

  1. WJ

    WJ Guest

    http://www.silverlion.com/staff/wjohnson/test/page1.html

    I am trying to make a button behave exactly like an href.
    Here is a sample of code from the link above.

    If I run this in firefox, it takes me to the next page find.
    IE fails. I'd like to do this without any script at all.

    Users just want buttons instead of hyperlinks.

    <html>
    <head>
    <title>Page 1</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <table cellpadding="0" cellspacing="0" border="0" width="800">
    <tr>
    <td align="center" height="100">
    <h1>Page 1</h1>
    </td>
    </tr>
    <tr>
    <td align="center" height="500">
    <a href="page2.html">
    <input type="button" name="test" value="Test">
    </a>
    </td>
    </tr> </table>

    </body>
    </html>
     
    WJ, Jan 19, 2006
    #1
    1. Advertising

  2. WJ

    Mark Parnell Guest

    Deciding to do something for the good of humanity, WJ <>
    spouted in alt.html:

    > I am trying to make a button behave exactly like an href.


    You've got it backwards. It *is* a link, so use the correct element
    (<a>). Once you have done that, you can worry about what it looks like.
    If you want it to look like a button, you can style the anchor
    appropriately.

    OTTOMH and not tested:

    a:link {display: block; width: 8em; height: 1.5em; background-color:
    #999999; border-top: 1px solid #CCCCCC; border-right: 1px solid #333333;
    border-bottom: 1px solid #333333; border-left: 1px solid #CCCCCC;
    text-decoration: none; color: #000000; cursor: default;}

    > Users just want buttons instead of hyperlinks.


    What makes you think that?

    --
    Mark Parnell
    =====================================================
    Att. Google Groups users - this is your last warning:
    http://www.safalra.com/special/googlegroupsreply/
     
    Mark Parnell, Jan 19, 2006
    #2
    1. Advertising

  3. WJ

    saz Guest

    In article <5NDzf.14155$V.1586@fed1read04>, says...
    >
    > http://www.silverlion.com/staff/wjohnson/test/page1.html
    >
    > I am trying to make a button behave exactly like an href.
    > Here is a sample of code from the link above.
    >
    > If I run this in firefox, it takes me to the next page find.
    > IE fails. I'd like to do this without any script at all.
    >
    > Users just want buttons instead of hyperlinks.
    >


    They do? Who told you that?
     
    saz, Jan 19, 2006
    #3
  4. WJ

    Toby Inkster Guest

    WJ wrote:

    > I am trying to make a button behave exactly like an href.


    <form action="http://www.example.com/page.html" method="GET">
    <div>
    <input type="submit" value="Go to Example Page">
    </div>
    </form>

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, Jan 19, 2006
    #4
  5. On Wed, 18 Jan 2006 22:02:28 -0600, saz <>
    wrote:

    >In article <5NDzf.14155$V.1586@fed1read04>, says...


    [...]

    >> Users just want buttons instead of hyperlinks.
    >>

    >
    >They do? Who told you that?


    For some reason, deezyners think that links should look like buttons,
    and that real buttons (as in form sumbit buttons) should look like
    links (or images).

    Nick
    --
    Nick Theodorakis

    contact form:
    http://theodorakis.net/contact.html
     
    Nick Theodorakis, Jan 19, 2006
    #5
  6. WJ

    saz Guest

    In article <>,
    says...
    > On Wed, 18 Jan 2006 22:02:28 -0600, saz <>
    > wrote:
    >
    > >In article <5NDzf.14155$V.1586@fed1read04>, says...

    >
    > [...]
    >
    > >> Users just want buttons instead of hyperlinks.
    > >>

    > >
    > >They do? Who told you that?

    >
    > For some reason, deezyners think that links should look like buttons,
    > and that real buttons (as in form sumbit buttons) should look like
    > links (or images).
    >
    > Nick
    >

    If he continues this submit button path, he will produce a very ugly
    webpage.
     
    saz, Jan 19, 2006
    #6
  7. WJ wrote:
    > http://www.silverlion.com/staff/wjohnson/test/page1.html


    You know, I went to your FAQ page, and it does not give me confidence
    in silverlion at all.

    Why mention you are 1/2 the price? 1/2 the price = 1/2 the quality.
    You get what you pay for. Charge according to the work you do. Not
    everyone looks at the price as the value of your work. You even
    mention it twice in your FAQ. No one cares about your price. they
    want confidence in you. This doesn't give them that.

    Why mention "bug free"? If a company hires you, they have already
    decided you will do good work. Don't give them any reason to doubt
    that.

    FIX YOUR WEB SITE! Why would I hire you to make me an application when
    your page is filled with errors?

    And Who asked these questions? Customers didn't. These are things you
    "think" a customer would ask you. They aren't.

    Just some thoughts
     
    Travis Newbury, Jan 19, 2006
    #7
  8. WJ

    bardgd

    Joined:
    May 27, 2007
    Messages:
    2
    If you are using dream weaver, you can make flash buttons that you can use in place of a hyperlink.
     
    bardgd, May 27, 2007
    #8
  9. WJ

    bardgd

    Joined:
    May 27, 2007
    Messages:
    2
    If you are using dream weaver, you can use it to make flash buttons that will work like a hyperlink.
     
    bardgd, May 27, 2007
    #9
  10. WJ

    DavidOxclove

    Joined:
    Apr 17, 2008
    Messages:
    1
    Wow... That's an awful lot of criticism just to avoid answering his question. From other people as well.

    Why can't you all just help? Is it that difficult?

    I don't why the OP wanted to have his hyperlink look like a button, but here's why I want it to.

    I have a Web Application that has an administrators section in it, seperate from the user's site.
    There's a "Manage Members" section that lists the users. There are also a number of filters on the page. Right now I have a button that directs them to a page that builds the list and exports it into an Excel file. I don't want the page to change to the download box or just display the excel spreadsheet, so a Response.Redirect is not an option. I tried using window.open but that doesn't give consistent results. I think the only option I'm left with is to have an asp hyperlink and set the NavigateUrl (with arguments passed via querystring, as they are now) when the search completes.

    And the client wants it to look like a button, not a link. And if you think the client is wrong and she should really want it to look like a link instead of a button in HER Admin, feel free to PM me and I'll pass your thoughts on.
     
    DavidOxclove, Apr 17, 2008
    #10
  11. WJ

    thekeyboardwizard

    Joined:
    Apr 18, 2008
    Messages:
    1
    Hyperlink to a button code is as follows:

    Internal Button Link

    <button onclick="location.href='#step1';"><div align="center"> Next </div></button>

    swap #step1 for www.youdomain.com/linkpage or what ever

    put this in your website

    ~~thekeyboardwizard~~
     
    thekeyboardwizard, Apr 18, 2008
    #11
  12. WJ

    adallas

    Joined:
    Mar 3, 2011
    Messages:
    1
    This seems to work

    There are many cases where a button is preferable to a hyperlink. A button implies an action, a hyperlink implies information navigation. A CSS-styled <a> implies page navigation.

    A list of records, with an 'Edit' and a 'Delete' link on each row still needs an 'Add' button. If the submit button is labeled 'OK', a 'Cancel' button might be nice. There are common, imo legitimate, reasons to want a button.

    In modern browsers (IE8, FF3), this code accomplishes it:

    <button type="button" onclick="window.location.href='yourUrlHere'">Label</button>

    The URL can be relative or absolute, and--obviously--you can run any Javascript you want in response to the button click. Use <input type="button"> in a <form>, and <button> outside a <form>.

    Ref: http://www.w3schools.com/tags/tag_button.asp
     
    adallas, Mar 3, 2011
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MattB
    Replies:
    6
    Views:
    14,214
    siddharthad
    Sep 21, 2006
  2. Replies:
    12
    Views:
    2,246
    Howard
    Jun 16, 2005
  3. =?Utf-8?B?Y2xpY2tvbg==?=

    How to make Dataset relationships behave like an SQL join

    =?Utf-8?B?Y2xpY2tvbg==?=, Jul 25, 2006, in forum: ASP .Net
    Replies:
    2
    Views:
    4,766
    =?Utf-8?B?Y2xpY2tvbg==?=
    Jul 25, 2006
  4. bill
    Replies:
    7
    Views:
    241
    Mick White
    Jul 7, 2004
  5. Replies:
    1
    Views:
    157
    nice.guy.nige
    Mar 10, 2007
Loading...

Share This Page