Pab
2011-Sep-14 11:58 UTC
rjs error TypeError: element.getElementsByTagName is not a function in rails 3+jquery
hi, i am using rails 3.0.10 i am trying with sample application for searching data from table and updating my search.html.erb file is <%= form_for (@employee) do |s|% <div id ="search_details"> <%= s.text_field :name%> <%= s.text_field :emp_id, :onfocus => ''sal(document.getElementById(''employee_name'').value);''%> </div> <% end %> when i click tab it calls sal() jquery function and i sent the data to action, in action parameter is processed well, but while replacing div with partial page i am getting following error like RJS error: TypeError: element.getElementsByTagName is not a function Element.update("upc_search", "\n \n <div >\n <table border \"1\">\n <tr>\n <th>\n <label >No</label> \n <br />\n <input tyep=\"text\" value=\"1\" size=\"30\"/>\n </th>\n <th>\n <label for\"id\" >id</label>\n <br />\n <input tyep=\"text \" value=\"0123456789123\" size=\"30\" />\n </th>\n <th>\n <label for=\"Name\" >Name</label>\n <br /> \n <input tyep=\"text\" value=\"Lotion\" size=\"30\" />\n </ th>\n </tr>\n </table>\n </div>\n\n <br />\n \n"); i used https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.js, https://ajax.googleapis.com/ajax/libs/jquery/1.6.3/jquery.js for jquery process could any one provide me solution ? thanks, -pab -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
7stud --
2011-Sep-14 17:39 UTC
Re: rjs error TypeError: element.getElementsByTagName is not a function in rails 3+jquery
You probably should''t use prototype methods when you''ve chosen jquery as your js framework. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder
2011-Sep-14 17:59 UTC
Re: rjs error TypeError: element.getElementsByTagName is not a function in rails 3+jquery
On Wed, Sep 14, 2011 at 4:58 AM, Pab <prabu.net88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> RJS error: > > TypeError: element.getElementsByTagName is not a functionExactly what it says: getElementsByTagName is a basic JavaScript function of *document*. So you need to look at your JS to see where that''s getting muddled... -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
7stud --
2011-Sep-14 20:55 UTC
Re: rjs error TypeError: element.getElementsByTagName is not a function in rails 3+jquery
Hassan Schroeder wrote in post #1021992:> On Wed, Sep 14, 2011 at 4:58 AM, Pab <prabu.net88-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> RJS error: >> >> TypeError: element.getElementsByTagName is not a function > > Exactly what it says: getElementsByTagName is a basic JavaScript > function of *document*. So you need to look at your JS to see where > that''s getting muddled...*wrong* -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hassan Schroeder
2011-Sep-14 21:04 UTC
Re: Re: rjs error TypeError: element.getElementsByTagName is not a function in rails 3+jquery
On Wed, Sep 14, 2011 at 1:55 PM, 7stud -- <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>>> TypeError: element.getElementsByTagName is not a function >> >> Exactly what it says: getElementsByTagName is a basic JavaScript >> function of *document*. So you need to look at your JS to see where >> that''s getting muddled... > > *wrong*Perhaps you could be a little more explicit about what part of that you consider to be "wrong" ? :-) -- Hassan Schroeder ------------------------ hassan.schroeder-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org http://about.me/hassanschroeder twitter: @hassan -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Pab
2011-Sep-15 14:54 UTC
Re: rjs error TypeError: element.getElementsByTagName is not a function in rails 3+jquery
Hi, how to avoid using prototype method ? thanks, -pab -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.