# Webrat and submitting a form using an image

**URL:** <https://www.ruby-forum.com/t/webrat-and-submitting-a-form-using-an-image/150146>\
**Category:** RSpec\
**Created:** [October 4, 2008, 6:09pm UTC](https://www.ruby-forum.com/t/webrat-and-submitting-a-form-using-an-image/150146 "2008-10-04T18:09:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [October 4, 2008, 6:09pm UTC](https://www.ruby-forum.com/t/webrat-and-submitting-a-form-using-an-image/150146/1 "2008-10-04T18:09:17Z")

</div>

Webrat doesn’t seem to be able to handle the submit of a form through an  
image input.

How do you handle that?

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [October 5, 2008, 5:18am UTC](https://www.ruby-forum.com/t/webrat-and-submitting-a-form-using-an-image/150146/2 "2008-10-05T05:18:10Z")

</div>

On Oct 4, 2008, at 12:09 PM, Fernando P. wrote:

> Webrat doesn’t seem to be able to handle the submit of a form  
> through an  
> image input.

Fernando, this should work, at least in trunk webrat. For example, see  
the specs near:

[http://github.com/brynary/webrat/tree/master/spec/api/clicks\_button\_spec.rb#L337](http://github.com/brynary/webrat/tree/master/spec/api/clicks_button_spec.rb#L337)

Are you seeing another behavior?

## Cheers from NYC, Luke

Luke M.  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> **[Luke Melia](https://www.lukemelia.com/)**
>
> The personal website of Luke Melia, a vegetarian software developer from New York City who attempts to live every day with passion.

---

<div class="post-metadata">

**Author:** ![fipa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/9e8a1a/32.png) [@fipa](https://www.ruby-forum.com/u/fipa)\
**Post date:** [October 5, 2008, 4:55pm UTC](https://www.ruby-forum.com/t/webrat-and-submitting-a-form-using-an-image/150146/3 "2008-10-05T16:55:07Z")

</div>

Thank you very much for the link! Actually my problem was that I have 2  
buttons on the page, and the only way to distinguish them is to use the  
alt tag which I wasn’t currently using. Now everything works perfectly.
