Jump to content

Button links in IE


ShadowMage

Recommended Posts

I've come across yet another bug. Though I was positive that this sort of thing could be done. I have a button link, like so:<a href='http://www.google.com'><input type='button' value='click here' /></a>and it works just fine in FF, but IE doesn't work. Clicking the button does nothing. Can anyone confirm that this is a bug in IE? How do I fix it? If I have to, I'll use JavaScript, but I didn't really want to do that since it's just redirecting to a different part of my site.

Link to comment
Share on other sites

Inputs aren't really meant to be wrapped in anchor tags (though it is valid) - maybe you want a <button> instead?

Link to comment
Share on other sites

Inputs aren't really meant to be wrapped in anchor tags (though it is valid) - maybe you want a <button> instead?
Ah, <button> right. Forgot about that! :) I'll try it, let you know if it works.EDIT:Unfortunately, that's not working either. :)
Link to comment
Share on other sites

If you want a button that acts like a link, just put it inside a form:

<form action="http://www.google.com" method="get"><div><input type="submit" value="Click here" /></div></form>

You can style the form and <div> elements to appear inline if necessary.

Link to comment
Share on other sites

Hmm....thanks for the suggestions guys, but I can't use an image or a div because this button is part of a menu which is made up of other buttons and it would look out of place. I don't know if I like the form idea as that seems to be a lot of extra markup just to make a button link. I think I'm going to use JavaScript. I won't have to worry about it being disabled because this is on an intranet and all of our browsers have JavaScript enabled. Once again, thanks for the suggestions! :)Why can't IE just play nice for once.... :)

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...