View Full Version : Rollover for <input type="image">?

Jul 22nd, 2002, 02:33 AM
I have a form that is using an image as the submit button. I've done it it the good old-fashioned way of
<input type="image>

What I want is a rollover effect, so that it will be consistent with the rest of my site.

I've tried adding onMouseOver events to the tag itself and wrapping the tag in <div>'s and adding the event to those as well. The problem is that even when I give the <input> tag name="enter" id="enter" attributes, I get an error saying "enter is undefined"

Any suggestions?

The effect should be compatible with DOM browsers, and degrade will back to NN4.0



Jul 22nd, 2002, 06:12 AM
I was going to write out what I thought you needed, but wasn't sure what you already had -- especially for the rollover portion. So, I did a quick Google search (http://www.google.com/search?as_q=image+input&num=30&hl=en&ie=UTF-8&oe=UTF-8&btnG=Google+Search&as_epq=submit+button&as_oq=rollover+onmouseover&as_eq=&lr=lang_en&as_ft=i&as_filetype=&as_qdr=all&as_occt=any&as_dt=i&as_sitesearch=&safe=images), and found tons of hits...the following of which may help:


http://www.cs.tut.fi/~jkorpela/forms/imagebutton.html (at the bottom)


Jul 22nd, 2002, 06:18 AM
Cool thanks for that. Guess I'll try a google search next time before I make a post!



Jul 22nd, 2002, 08:40 AM
Searching these CodingForums.com forums first is generally best. Being that this is the *new* forum site, it's also a good idea to search the *old* forum site (linked in the top right corner). Past that, I always go with an "advanced search" on Google.

But, it's also not the worst thing in the world to post your queries here as well. It all depends. Regardless, your post and/or the replies to it may well someday help out another individual with the same or similar question.