Hi Everyone, I need your help. I have created a form that makes an Ajax call to submit the data. It is working fine on 1 page of the site (http://www.tripoutlook.com/home/contact) and same code is not working properly at the other page (http://www.tripoutlook.com/home/publishers) It seems like page.call function is not getting handled properly i.e. on successful form submission, controller does the following - render :update do |page| page << "$(''contact_us_table'').hide();" page << "$(''contact_status'').show();" end which should hide the contact form and display a message. Instead, for http://www.tripoutlook.com/home/publishers, it just dumps the following - page << "$(''contact_us_table'').hide();" page << "$(''contact_status'').show();" How can I fix this? -- 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 -~----------~----~----~----~------~----~------~--~---
Rajat Garg wrote:> I have created a form that makes an Ajax call to submit the data. > > It is working fine on 1 page of the site > (http://www.tripoutlook.com/home/contact) and same code is not working > properly at the other page (http://www.tripoutlook.com/home/publishers) > > It seems like page.call function is not getting handled properly i.e. > > on successful form submission, controller does the following - > render :update do |page| > page << "$(''contact_us_table'').hide();" > page << "$(''contact_status'').show();" > end > > > which should hide the contact form and display a message. > > Instead, for http://www.tripoutlook.com/home/publishers, it just dumps > the following - > page << "$(''contact_us_table'').hide();" > page << "$(''contact_status'').show();" > > How can I fix this?I''d say you have to change your submit onclick handler to call this.form.onsubmit() instead of this.form.submit(). Perhaps instead of a remote_form and a normal submit button you should use a normal form and a submit_to_remote button with onclick JS "this.disabled=true;this.value=''Sending...''" -- Rails Wheels - Find Plugins, List & Sell Plugins - http://railswheels.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 -~----------~----~----~----~------~----~------~--~---