# Submit buttons with rollover images

**URL:** <https://www.ruby-forum.com/t/submit-buttons-with-rollover-images/120725>\
**Category:** Rails\
**Created:** [November 20, 2007, 3:21am UTC](https://www.ruby-forum.com/t/submit-buttons-with-rollover-images/120725 "2007-11-20T03:21:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [November 20, 2007, 3:21am UTC](https://www.ruby-forum.com/t/submit-buttons-with-rollover-images/120725/1 "2007-11-20T03:21:59Z")

</div>

The image\_submit\_button helper makes it easy enough to use images as  
submit buttons, but they don’t have any rollover effects. I’ve seen  
various JS approaches to make this work, but I’m wondering if there’s  
a preferred Rails way to do this.

Has anyone seen a replacement for image\_submit\_button that takes two  
(or three) images instead of one, and creates the rollover code?

Michael

---

<div class="post-metadata">

**Author:** ![wickie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/ba9def/32.png) [@wickie](https://www.ruby-forum.com/u/wickie)\
**Post date:** [January 28, 2009, 2:14pm UTC](https://www.ruby-forum.com/t/submit-buttons-with-rollover-images/120725/2 "2009-01-28T14:14:27Z")

</div>

Michael S. wrote:

> The image\_submit\_button helper makes it easy enough to use images as  
> submit buttons, but they don’t have any rollover effects. I’ve seen  
> various JS approaches to make this work, but I’m wondering if there’s  
> a preferred Rails way to do this.
> 
> Has anyone seen a replacement for image\_submit\_button that takes two  
> (or three) images instead of one, and creates the rollover code?
> 
> Michael

This is the “rails” aproach…

\<%= image\_submit\_tag “btn-off.jpg”, :mouseover =\> “btn-on.jpg”%\>

🙂

Regards
