Topic: rjs problem (error displaying)

i'm heaving a big problem 'displaying' a select field that depends on selection of the previous select field. Now i'm stuck on the next thing. on the picture below you can see that when i select something in the first list (red outline) the second one (blue outline) is generated and shown. I just think it is shown on screen as a part of java error (2 times)??. Otherwise it works perfectly smile its just the text around that is bugging me ("try { new Insertion.Top..."). I know nothing about java and too little about rails rjs to fix this so i'm asking for your help.
example 1
example 2

Here is the relevant is messy, because i was trying to fix this and was changing it a lot.

#_form.rhtml (part)
<div class="form-element_customer">
<select id="customerId" name="customer" onChange=
    "<%= remote_function(:url => {:action => :update_projects}, :with => "this.value", :update => 'projectId') %>">
    <% for cust in @customers  %>
        <option value=<%= %>><%= cust.desc %></option>
    <% end  %>

<div class="form-element_project">
<div id="projectId">

    <% for project in @projects %>
        <option value=<%= %>><%= project.desc %></option>
    <% end %>

#hours_controller.rb (part)
def update_projects
    $temp = request.params.keys.first
    @customers = session[:user].validCustomers()
    @projects = Project.find(:all, :conditions => ['user_id = ? AND customer_id = ?',session[:user].id, $temp])
    return render(:action => 'update_projects.rjs') if request.xhr?

page.insert_html :top, "projectId", :partial => "form2"

I would REALLY appreciate your help.

Re: rjs problem (error displaying)

You shouldn't pass the :update parameter while using RJS:

<%= remote_function(:url => {:action => :update_projects}, :with => "this.value") %>

That should fix it.

Railscasts - Free Ruby on Rails Screencasts