surjya hazarika
2005-Dec-06 11:59 UTC
Cant identify Multiple Submit Buttons in form_remote_tag
Hi, Like Derek, I also found a bug in the form_remote_tag function. Whenever there are two or more Submit buttons, rails is not able to identify as to which Submit button has been clicked. On the otherhand Non-AJAX forms work perfectly. If possible please throw some light into this. regards.. Prasad Tr S/W Engineer, Genie Interactive -- Posted via http://www.ruby-forum.com/.
Neha Chopra
2008-Jan-29 17:52 UTC
Re: Cant identify Multiple Submit Buttons in form_remote_tag
Surjya Hazarika wrote:> Hi, > Like Derek, I also found a bug in the form_remote_tag function. > Whenever there are two or more Submit buttons, rails is not able to > identify as to which Submit button has been clicked. On the otherhand > Non-AJAX forms work perfectly. If possible please throw some light into > this. > > regards.. > Prasad > Tr S/W Engineer, > Genie InteractiveHi, If you have a form that calls for submisions to various functions then try the following code in your own way. <%= hidden_field_tag(''commit'', ''add_another_criteria'') %> <%= submit_tag(''Add Another Search Term'', :name => ''_commit'') %> <%= submit_tag(''Generate Report'', :name => ''_commit'', :onclick => "Form.getInputs(this.form, null, ''commit'')[0].value = ''Generate Report''") %> Then in your method, check the params passed for each button click and depending on that you can do the server side programming. Hope this helps. -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---