Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

Button link works in Chrome and Firefox, not IE

Mar 13, 2012 4:21AM PDT

Discussion is locked

- Collapse -
Answer
Is that IE prior to IE9?
Mar 13, 2012 4:29AM PDT

If so, have a look at http://www.w3schools.com/tags/tag_button.asp and their "Tips and Notes".

It seems that in IE prior to IE9 you need to use text between the button tags, whereas IE 9 and other browsers submits the content of the value attribute, eg an image.

Mark

- Collapse -
Unsure about the meaning of "submit"
Mar 13, 2012 5:18AM PDT

Yes thanks, it's IE8. Since I'm not using the button in a form, I'm a bit unclear about the note "If you use the <button> element in an HTML form, different browsers may submit different values." It's not supposed to submit any data. The image appears properly in each browser; it's just the <a> tag that doesn't seem to be working.

I'll see if I can find a machine with IE9 to try it on.

- Collapse -
Submit
Mar 13, 2012 5:50AM PDT

Yep I am not an expert and I am not confident about his use of the word Submit, but I assume it means a click 'submits' an instruction to be followed, like a javascript on_click event.

{LOL, I had to separate on and click and the forum software would not allow me to use the two words together. Security reasons I imagine.}

So when you click the button in Firefox, Chrome, etc, it submits the click to take the user to the Google home page. But in IE8 and below that fails as IE8<= expects text in place of the image.

If you replace the button tag with Form and Input, it should be OK.

There are ways to use HTML to identify which browser and which version of that browser the user is using, and you might need that if you are publishing this web page, because many IE users are still using IE8 and below as XP and below does not accept IE9.

Mark

- Collapse -
Guess I'm back to using a plain image
Mar 14, 2012 1:48AM PDT

I tried using <input> but it doesn't allow me to use an image on the button. I also tried using <button> with window.open but javascript doesn't work well with the database-driven site.

I thought this would be much simpler--I guess I'll just go back to putting the image inside <a> tags and give up on the fancy clicking action of a 3D button. A pity as my original button worked perfectly in browsers except IE8, including mobile browsers!

- Collapse -
I understand the difficulties.
Mar 14, 2012 5:06AM PDT

But if you can find out how to check which browser (and version) is being used, you can still do this. then you can add code for the IE8 and below browsers whilst IE9 users and other browser type users would see the buttons as you designed them.

Not easy as you would probably need to do the recognition in Javascript, but it can be done.

Mark

- Collapse -
Answer
I would probably
Mar 17, 2012 2:14PM PDT

omit the button all together and just link the image. If you need something that looks like a button, you can just style the link to emulate one.

~Sovereign

- Collapse -
Answer
Use JS
Jun 14, 2012 10:55PM PDT