Is there a way to do an ajax submit but only send the values in an embedded form inside a form? I have to do an ajax submit with multiple companies and I get this being submitted for the post: companyid 1 companyid 2 companyid 3 If I have multiple submits possible but I need to be able to get the appropriate company id that is submitted.
On May 3, 6:41 am, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Is there a way to do an ajax submit but only send the values in an > embedded form inside a form? >nested forms are not allowed by the html standard. When making an ajax request you can however submit an arbitrary element to submit. Fred> I have to do an ajax submit with multiple companies and I get this > being submitted for the post: > > companyid 1 > companyid 2 > companyid 3 > > If I have multiple submits possible but I need to be able to get the > appropriate company id that is submitted.
I have been using fields_for for my inline ajax forms. How do submit text fields using a button_to_function? I have several inline forms using ajax calls to do CRUD for my contact info. On Sun, May 3, 2009 at 4:42 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On May 3, 6:41 am, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Is there a way to do an ajax submit but only send the values in an > > embedded form inside a form? > > > nested forms are not allowed by the html standard. When making an ajax > request you can however submit an arbitrary element to submit. > > Fred > > > I have to do an ajax submit with multiple companies and I get this > > being submitted for the post: > > > > companyid 1 > > companyid 2 > > companyid 3 > > > > If I have multiple submits possible but I need to be able to get the > > appropriate company id that is submitted. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I have this ajax form that could be disaplyed multiple times on the page: If it is displayed multiple times when i do the ajax submit I get those same fields submitted. Is there a way to differentiate between them all? <% fields_for :site do |f|%> <%= f.text_field "company",'''', :size => ''6'' %> <%= f.text_field "Customer",'''', :size => ''6'' %> <%= hidden_field_tag ''companyid'','''', :value => @company.id %> <%= submit_to_remote ''addsite'',''Add Site'', :url => { :controller => ''addsites'', :action => ''addsitetomop'', :id=> @mop }%> <% end %> In firebug this is what it looks like: site[Customer] site[Customer] site[company] site[company] . If I do a "button_to_function remote_function" is there a way to send the text fields values across? On Sun, May 3, 2009 at 4:42 AM, Frederick Cheung <frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > > On May 3, 6:41 am, Me <chabg...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > Is there a way to do an ajax submit but only send the values in an > > embedded form inside a form? > > > nested forms are not allowed by the html standard. When making an ajax > request you can however submit an arbitrary element to submit. > > Fred > > > I have to do an ajax submit with multiple companies and I get this > > being submitted for the post: > > > > companyid 1 > > companyid 2 > > companyid 3 > > > > If I have multiple submits possible but I need to be able to get the > > appropriate company id that is submitted. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---