views:

413

answers:

2

Hi all.

I have the following in an html form using method Post.

<input type="submit" title="" class="myclass" value="" />

and:

.myclass {
background: url(../images/image1.png)  no-repeat; border: none;
width: 165px;
height: 59px;
}

Basically, I need my form information to be posted using an image1.png button, and when hovered, image2.png would be called. Would you recommend CSS or javascript, and what would be the exact way to do it?

Thank you everyone, it's been answered!

+2  A: 

Submit button:

  <input type="image" title="" class="myclass" src="../images/image1.png" />

CSS:

.myclass:hover {
background: url(../images/image2.png)  no-repeat; border: none;
width: 165px;
height: 59px;
}
Sarfraz
That was my first attempt, but it doesn't seem to work when the class is called in as a submit button. Or am I wrong?
skarama
Nevermind, it works perfectly!
skarama
that is good news.
Sarfraz
A: 

If you can make use of jquery, have a look at this

Events/hover

astander
Thank you I'll give it a read for future reference!
skarama