469,271 Members | 1,425 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Firefox problems with <img> tags

Hi there,

This code is working fine in IE7 as submit button for the search form, but not in Firefox. Any ideas why.

Expand|Select|Wrap|Line Numbers
  1. <img src="../../Images/Go.jpg" width="45" height="20" align="absmiddle" style="Cursor:Hand;" onClick="funcSearchUsers();"> 
Thanks.
May 2 '07 #1
6 5202
I fogot to mention what is the error!!!

It does not recognize it as button or clickable.

Thanks.

Terry
May 2 '07 #2
drhowarddrfine
7,435 Expert 4TB
There is no cursor:hand. Change it to pointer and see if it works with that.
May 2 '07 #3
pronerd
392 Expert 256MB
It does not recognize it as button or clickable.
That is because it is not a button. Is it possible that another layer in the page is sitting on top of the image preventing it from being clicked on? Does it work if you remove the style and align attributes? Neither of the values being used look like they are supported.
May 6 '07 #4
I tried removing the styles but that did not help. Any other ideas.

Thanks for the reply
May 12 '07 #5
pbmods
5,821 Expert 4TB
As general nitpickery, it s/b "onclick" instead of "onClick", and your img tag should be closed with a "/>" insead of ">". I doubt these will solve the problem, but it will make the W3 Validator like your site better :)

Does Firefox give you an error when you click on the image, or does nothing happen? Is the function supposed to do something every time you invoke it, or are there situations where it might return without doing anything visible? Have you put an alert at the head of funcSearchUsers to verify that it is being invoked properly?

Your tag looks fine. I wonder if the problem is in the context. Post some relevant code around your tag.
May 12 '07 #6
gits
5,390 Expert Mod 4TB
hi ...

does it really dont work? i tried it on a firefox 2.0.0.3 and it works ... onclick fires and the function will be called ... there are the following things to mention:

- the image doesn't look like clickable ... its a pure img but you may (and you have) attach(ed) an event-handler ... click on the image calls the function ...
- in safari that is also recognized and you get the hand as cursor when moving the mousepointer over the image ...

- so the best way to give the user feedback that this image is clickable is ... a rollover ... switch the image-source on mouseover and show another image ... so the user recognize that there is something clickable and performs the action ... perhaps you find another style that shows another mousepointer in case of firefox ... but i personally would prefer the rollover-solution
May 12 '07 #7

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Mike Ritter | last post: by
15 posts views Thread by Philipp Lenssen | last post: by
1 post views Thread by Michael | last post: by
9 posts views Thread by Wladimir Borsov | last post: by
2 posts views Thread by ThePsudo | last post: by
1 post views Thread by Carl | last post: by
4 posts views Thread by Jon Slaughter | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.