Forum: Rails-core (closed, excessive spam) Image buttons broken in form_remote_tag

Posted by Greg Willits (-gw-)
on 2008-05-11 20:57
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,
http://www.ruby-forum.com/topic/150383, 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 :-)
Posted by Greg Willits (-gw-)
on 2008-05-29 10:35
No thoughts on this one?

-- gw
Posted by Michael Koziarski (Guest)
on 2008-06-01 02:09
(Received via mailing list)
> 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.

--
Cheers

Koz
Posted by Greg Willits (-gw-)
on 2008-06-01 02:22
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

Posted by Mislav MarohniÄ? (mislav)
on 2008-06-01 03:45
(Received via mailing list)
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.


On Sun, Jun 1, 2008 at 2:22 AM, Greg Willits <
This topic is locked and can not be replied to.