Hi, I am trying to submit the whole form as part of the AJAX request. To achieve this I am using $(''myForm'').request({method:''POST'', onSuccess:function(response) { alert("success"); }, onFailure:function(response) { alert("Failed"); }, onComplete:function(response) { alert("onComplete"); } }); The method works perfectly in IE6+. This is throwing a javascript error. Error: $(''myForm'') has no properties. I am using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: 1.8.1.11) Gecko/20071127 Firefox/2.0.0.11. Is anything wrong with the way I am using? Would appreciate your help towards resolving the issue. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
take a look on the api doc http://www.prototypejs.org/api/form/request and the code of your form? maybe you don''t have the id attribute myForm <form id="myForm" name="myForm"...... On Dec 13, 2007 12:28 AM, uvasamrat <anil.mannem-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Hi, > > I am trying to submit the whole form as part of the AJAX request. To > achieve this I am using $(''myForm'').request({method:''POST'', > onSuccess:function(response) > { > > alert("success"); > }, > > onFailure:function(response) > { > > alert("Failed"); > }, > > onComplete:function(response) > { > > alert("onComplete"); > } > }); > The method works perfectly in IE6+. This is throwing a javascript > error. > Error: $(''myForm'') has no properties. > > I am using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: > 1.8.1.11) Gecko/20071127 Firefox/2.0.0.11. > > Is anything wrong with the way I am using? > > Would appreciate your help towards resolving the issue. > > > >-- {a human being that was given to fly} --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Waypoint Systems
2007-Dec-18 16:29 UTC
Re: $(''form'').request() not working in Mozilla Firefox
You may be getting this error because the element doesn''t exist on the page yet, if your javascript appears in your HTML before the element try wrapping your code in the Event.observe wrapper for example: Event.observe(window,''load'',function(){ //Your code here will be executed after the page has loaded. }); This means the script will wait untill all the elements on the page have loaded before it attempts to look at your form. Hope that''s of some help. On Dec 13, 6:28 am, uvasamrat <anil.man...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am trying to submit the wholeformas part of the AJAXrequest. To > achieve this I am using $(''myForm'').request({method:''POST'', > onSuccess:function(response) > { > > alert("success"); > }, > onFailure:function(response) > { > > alert("Failed"); > }, > onComplete:function(response) > { > > alert("onComplete"); > } > }); > The method works perfectly in IE6+. This is throwing a javascript > error. > Error: $(''myForm'') has no properties. > > I am using Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: > 1.8.1.11) Gecko/20071127 Firefox/2.0.0.11. > > Is anything wrong with the way I am using? > > Would appreciate your help towards resolving the issue.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---