# Again, AJAX forms with multiple submit buttons

**URL:** <https://www.ruby-forum.com/t/again-ajax-forms-with-multiple-submit-buttons/111325>\
**Category:** Rails\
**Created:** [August 6, 2007, 3:13am UTC](https://www.ruby-forum.com/t/again-ajax-forms-with-multiple-submit-buttons/111325 "2007-08-06T03:13:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [August 6, 2007, 3:13am UTC](https://www.ruby-forum.com/t/again-ajax-forms-with-multiple-submit-buttons/111325/1 "2007-08-06T03:13:01Z")

</div>

Hi,

I’m trying to use an AJAX form with multiple submit buttons and am  
getting the same result whatever button I click.

I’ve seen this discussion, but it doesn’t help me. The patch to  
ActionView::Base only works in Firefox but not in IE (at least for  
me). And, I’ve got more than one button, so disabling the other one  
doesn’t do the trick.

Then, I’ve found this bug, and it’s closed, with a patch:  
[http://dev.rubyonrails.org/ticket/5031](http://dev.rubyonrails.org/ticket/5031)  
But, for the life of me, I can’t find where to apply this patch.

Any recent fix for this problem?

Thanks,  
Amir

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [August 6, 2007, 3:53am UTC](https://www.ruby-forum.com/t/again-ajax-forms-with-multiple-submit-buttons/111325/2 "2007-08-06T03:53:07Z")

</div>

helzer wrote:

> I’m trying to use an AJAX form with multiple submit  
> buttons and am getting the same result whatever  
> button I click.

Forms cannot be nested. It’s in the W3C spec. OTOH, you can have as  
many  
forms on the page as you want. You don’t need to worry about disabling  
submit buttons. Worry about how you’re going to get information that’s  
been  
entered into ‘forms’ that haven’t been submittted. Ajax is a different  
paradigm.

HTH,  
Bill

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [August 6, 2007, 1:18pm UTC](https://www.ruby-forum.com/t/again-ajax-forms-with-multiple-submit-buttons/111325/3 "2007-08-06T13:18:57Z")

</div>

Hi Bill,

The case is more simple. What I have is a single form with a few  
submit buttons.  
The input fields are check-boxes and the submit buttons are the  
required action.

It appears that there’s a long-awaiting Rails bug regarding getting  
the submit button information from AJAX forms.  
I was wondering if there’s been any change to this bug from the last  
time is was discussed here about a year ago:  
[http://groups.google.com/group/rubyonrails-talk/browse\_thread/thread/dad559c19fc272b5/859652d68af553d0](http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/dad559c19fc272b5/859652d68af553d0)

It should be a frequent thing in many applications, so I’m hoping  
there’s a good fix for this problem.

Amir

---

<div class="post-metadata">

**Author:** ![helzer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@helzer](https://www.ruby-forum.com/u/helzer)\
**Post date:** [August 6, 2007, 1:24pm UTC](https://www.ruby-forum.com/t/again-ajax-forms-with-multiple-submit-buttons/111325/4 "2007-08-06T13:24:57Z")

</div>

unsubscribe
