Re: Javascript with select in partial

Narendra sisodiya
Sun, 30 Aug 2009 06:25:08 -0000

you need to put javascript function in parent page from where you are
calling the partial
N a R e N


On Sat, Aug 29, 2009 at 10:21 PM, RVince <rvince99@hotmaile wherent
pag>wrote:

>
> I have the following partial, listed at the bottom of this post. It
> has a Javascript function with it, and a select, and an observe field
> on the select.
>
> Everything works fine when it is loaded with the entire page, but
> rendering the partial alone, of course, the javascript will not
> execute. How can I force the javascript function to execuste when I do
> subsequent
> render  :partial => ''thispartial''
>
> Thanks RVince
> -------------_thispartial.html.erb-------------
>
>
> function doReset(){
>
document.getElementById("channelnotes").options.selectedIndex = 0;
>        document.getElementById("channelnotes").options
> [document.getElementById
> ("channelnotes").options.selectedIndex].value="";
> }
>
>
> <%= select("channelnotes", "channelnotes",
Channelnote.find
> (:all,  :order => ''tstamp DESC'', :limit =>3,
:conditions =>
> ["deleted=0"]).collect {|p| [ p.note, p.note]}, { :include_blank
=>
> true , :selected=>0, :value=>""},{}) %>
> <%=  observe_field "channelnotes", :url => {:controller
> => :channels, :action => ''notesboxchange'' },
:frequency => 1.0, :with
> =>  "''channelnotes='' + value" %>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---