Javascript with select in partial

RVince
Sat, 29 Aug 2009 16:51:20 -0000

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" %>