enoyhs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Aug-03 23:24 UTC
Prototype AJAX functions.
Hi all! I have a form that when user fills he will press submit button which have effect "onClick:previewMessage()". previewMessage() function is an Ajax.update function. I would like to know how can I get form data into other file which I''m accessing with AJAX? I hope I made myself clear. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On Aug 3, 2007, at 5:24 PM, enoyhs-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> I hope I made myself clear.Not really.> I have a form that when user fills he will press submit button which > have effect "onClick:previewMessage()". previewMessage() function is > an Ajax.update function.Use onSubmit, not onClick.> I would like to know how can I get form data into other file which I''m > accessing with AJAX?RT[F]M. Or, use Form.serialize(). I think this is what you''re looking for: Event.observe(''myFormId'', ''submit'', function(evt) { Ajax.Updater(''someDivId'', url, { parameters: Form.serialize(''myFormId'', true); } }); http://prototypejs.org/api/form/serialize http://prototypejs.org/api/ajax/updater TAG --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---