I have following code. I have included the javascript file at the top of page. Still it is giving errors CODE: <p> <%= f.label :content %><br /> <%= f.text_area :content, {onkeyup="strcount(1);chngcnt(1);" onkeydown="chngcnt(1);" onblur="chngcnt(1);" onfocus="chngcnt(1);} %> </p> ERROR: compile error /home/abc/Desktop/workspace/group_paging/app/views/messages/new.html.erb:12: odd number list for Hash ...ount(1);chngcnt(1);" onkeydown="chngcnt(1);" onblur="chngcnt... Please help me in calling the javascript function on following events. Where Am I 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-/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 -~----------~----~----~----~------~----~------~--~---
Solved. <%= f.label :content %><br /> <%= f.text_area :content, :id=>"message1",:onkeyup=>"strcount(1);chngcnt(1);" ,:onkeydown=>"chngcnt(1);" ,:onblur=>"chngcnt(1);", :onfocus=>"chngcnt(1);" %> </p> Thanks. -- 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 -~----------~----~----~----~------~----~------~--~---
> <%= f.text_area :content, {onkeyup="strcount(1);chngcnt(1);" > onkeydown="chngcnt(1);" onblur="chngcnt(1);" onfocus="chngcnt(1);} %>The errors come from Ruby - inside the <%%> tag - not from Javascript. Google for [ruby option hash], and compare it to what you wrote. You need more symbols and arrows in there... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---