Image buttons broken in form_remote_tag

I have a form submitted using form_remote_tag. I have two image buttons in this form.

In the params I am getting from my form in Rails, I get hash entries for all button names with no .x or .y extensions and no other indicator as to which button was clicked.

The output of essentially doing debug(params) simply shows     btnSearch: ""     btnClear: ""

In a plain non-ajax form, the click locations are available as expected.

I brought this up in the general forum a whil back, How detect image button clicks? - Rails - Ruby-Forum, and Frederick had a work around, but it was too heavy for my taste (my time needed elsewhere).

As Fred pointed out, this might be a Prototype problem and not a Rails one per se, but hopefully it can be looked into either way. It's a huge barrier that prevents me from using Ajax in Rails applications because my UIs depend heavily on detecting image button clicks.

-- gw

P.S. -- I thought of reporting it as a bug, but I can't figure out the new Lighthouse system -- I don't see how to add tickets, and as far as I can tell the exising ones aren't even searchable. Maybe it requires a sign up, but is the average schmoe supposed to sign up? Is that just for code contributors? The whole thing isn't very clear IMO, so I'll start here instead :slight_smile:

No thoughts on this one?

-- gw

No thoughts on this one?

Sorry no one got back to you.

This is a limitation of prototype's form serialization, so it'd require a fix there before we'd be able to do anything about it. I can't think of a nice way for them to do it, but you could try on their list.

Michael Koziarski wrote:

No thoughts on this one?

Sorry no one got back to you.

This is a limitation of prototype's form serialization, so it'd require a fix there before we'd be able to do anything about it. I can't think of a nice way for them to do it, but you could try on their list.

My JS skills are miniscual, so I'd have no idea how to fix it either. I'll poke around over there and see what I can stir up.

thx.

-- gw

I don’t think this issue will ever be solved entirely within Prototype. Here is a drop-in script you can use in your application.js, it should work http://pastie.org/206637

If you want to discuss, keep it on #prototype IRC or rails-spinoffs mailing list.