Making html button behave like hyperlink

W

WJ

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>
 
M

Mark Parnell

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?
 
N

Nick Theodorakis

[...]
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
 
S

saz

[...]
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.
 
T

Travis Newbury

WJ said:

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
 
Joined
May 27, 2007
Messages
2
Reaction score
0
If you are using dream weaver, you can make flash buttons that you can use in place of a hyperlink.
 
Joined
May 27, 2007
Messages
2
Reaction score
0
If you are using dream weaver, you can use it to make flash buttons that will work like a hyperlink.
 
Joined
Apr 17, 2008
Messages
1
Reaction score
0
Travis Newbury said:
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

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.
 
Joined
Mar 3, 2011
Messages
1
Reaction score
0
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,265
Messages
2,571,069
Members
48,771
Latest member
ElysaD

Latest Threads

Top