Forum Moderators: open

Message Too Old, No Replies

<img> as button does not work in FF

         

terry13

11:10 pm on May 2, 2007 (gmt 0)

10+ Year Member



I am trying to use this code which works fine in IE7 but not in FF. Any ideas on why? The problem is does not recognize it as a button.

<img src="../../Images/Go.jpg" width="45" height="20" align="absmiddle" style="Cursor:Hand;" onClick="funcSearchUsers();">

Thanks.

Terry

stajer

11:35 pm on May 2, 2007 (gmt 0)

10+ Year Member



I think what you want is:

<input type="image"...

Xapti

6:53 pm on May 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Dude... Why don't you just make a link with an image in it, or a sized block-level link with a background image, or as someone already said, an input with image type (which I've never used, personally).

As a link, just make the src="javascript:funcSearchUsers();"

And the attributes you put in your img tag (especially stuff like align) can be done with CSS styles.

And are you sure FF didn't recognize it as a button? Maybe javascript was disabled, or maybe you didn't even try clicking, just stopped when you saw that the cursor didn't change to a hand... "Hand" Isn't a valid cursor to choose from... I don't know where you got it from, or why it works with IE (IE is garbage by the way). The cursor you want to use is "pointer".
Like I said though, that in itself wouldn't make it not work if you clicked it though... I'm just guessing you didn't click it because the cursor didn't even change. Either that, or you did click it, but javascript was disabled.

[edited by: Xapti at 7:03 pm (utc) on May 4, 2007]