Hi,
I want to update a select box depending on another selected option thru
ajax.
Heres how I do it
_form.rhtml
<select id=“budget_coordinator_id” name=“budget[coordinator_id]”
onchange="<%= remote_function(:update => “budget_project_number”, :url
=> { :action => :get_projects }) %>">
<%= options_from_collection_for_select(Coordinator.find_all, “id”,
“coordinator_name”) %>
#get_projects
def get_projects
@results = Project.find_all
render :partial => ‘options’
end
_options.rhtml
<% for project in @results do -%>
<%=project.project_number%> <% end -%>This somehow seem to work in firefox, but not in IE. also the ajax calls
returns the whole options tag… instead of this, can we just return the
result object and then populate the select on the client side?
Advanced Thanx for any help!
Sandosh