Hi, this is a form created by a form_remote_tag <form id="markIt" onsubmit="new Ajax.Request(''/browser/ mark_name_ajaxed/1?name=Jacob&sex=0'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" method="post" action="/browser/mark_name_ajaxed/1? name=Jacob&amp;sex=0"> <input class="markit" type="image" src="/images/markit.jpg?1176473311"/></form> <img id="next" src="/images/next.jpg?1176473278" onclick="updateName();return false;"/> when I onclick a link (outside the form) I''d change the form''s onsubmit parameters, or even the entire function call.. anyway to get an updated call like this one: new Ajax.Request(''/browser/mark_name_ajaxed/2?name=Julia&sex=1'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false; where id, name and sex are coming as variables from the javascript code. I can easily update the .action property of the form. Wondering if and how I can do that for ajax call onsubmit. Thanks a lot, Enrico --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
What you are asking for is not very clear. On Jun 11, 10:45 am, agenteo <agen...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > this is a form created by a form_remote_tag > > <form id="markIt" onsubmit="new Ajax.Request(''/browser/ > mark_name_ajaxed/1?name=Jacob&sex=0'', {asynchronous:true, > evalScripts:true, parameters:Form.serialize(this)}); return false;" > method="post" action="/browser/mark_name_ajaxed/1? > name=Jacob&amp;sex=0"> > <input class="markit" type="image" src="/images/markit.jpg?1176473311"/ > > </form> > <img id="next" src="/images/next.jpg?1176473278" > onclick="updateName();return false;"/> > > when I onclick a link (outside the form) I''d change the form''s > onsubmit parameters, or even the entire function call.. anyway to get > an updated call like this one: > > new Ajax.Request(''/browser/mark_name_ajaxed/2?name=Julia&sex=1'', > {asynchronous:true, evalScripts:true, > parameters:Form.serialize(this)}); return false; > > where id, name and sex are coming as variables from the javascript > code. > > I can easily update the .action property of the form. Wondering if and > how I can do that for ajax call onsubmit. > Thanks a lot, > Enrico--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Sorry, I''ll try to be more clear. I have a form with the onsubmit property filled with the standard ajax code for the Rails form_remote_tag I need to change that property, and update query string Example: at first page loadI have this on the "onsubmit" event of the form: onsubmit="new Ajax.Request(''/browser/ mark_name_ajaxed/1?name=Jacob&sex=0'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false;" when I click on a link, it should change to: new Ajax.Request(''/browser/mark_name_ajaxed/2?name=Julia&sex=1'', {asynchronous:true, evalScripts:true, parameters:Form.serialize(this)}); return false; as you can see the query string values are changed: - id - name - sex I''m wondering how/if can I do that from a client side Javascript. Thanks, Enrico --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---