How to stop invoking a method more than one times when this method has submitted to server.My shopping system have methods to manage bill,ship,pay.... But i found when i was submitting a method such as bill,i can still flush or use keyboard in the browser to invoke this method many times.This will make one cart corresponding many bill,ship,pay....parts.But i wish that one cart can only correspond one bill,ship,pay...part.How do i make this reality? Thank you -- 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 -~----------~----~----~----~------~----~------~--~---
You could use JavaScript to disable the submit after the first time. On Feb 9, 5:44 am, Guo Yangguang <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> How to stop invoking a method more than one times when this method has > submitted to server.My shopping system have methods to manage > bill,ship,pay.... > But i found when i was submitting a method such as bill,i can still > flush or use keyboard in the browser to invoke this method many > times.This will make one cart corresponding many > bill,ship,pay....parts.But i wish that one cart can only correspond one > bill,ship,pay...part.How do i make this reality? > Thank you > -- > Posted viahttp://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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Use the :disable_with parameter in your form submit tag On Feb 9, 9:44 am, Guo Yangguang <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> How to stop invoking a method more than one times when this method has > submitted to server.My shopping system have methods to manage > bill,ship,pay.... > But i found when i was submitting a method such as bill,i can still > flush or use keyboard in the browser to invoke this method many > times.This will make one cart corresponding many > bill,ship,pay....parts.But i wish that one cart can only correspond one > bill,ship,pay...part.How do i make this reality? > Thank you > -- > Posted viahttp://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 -~----------~----~----~----~------~----~------~--~---
Thank you!I will try it.It should be like that. Mukund wrote:> Use the :disable_with parameter in your form submit tag > > On Feb 9, 9:44 am, Guo Yangguang <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>-- 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 -~----------~----~----~----~------~----~------~--~---