observe_field not generating any script

Hi - I have a view:

<% content_for(:page) do %> <h1>New user</h1>

<% form_for :user, @user, :url => { :action => "create" } do |form| %>   <%= render :partial => 'form', :locals => { :form => form, :genders => @genders} %>   <%= submit_tag "Create" %> <%end%>

<% observe_field("user_country", :function => "alert('Element changed')") %> <========= line of interest

<%end%>

which renders a partial, and includes a select with id "user_country"

The html for this is:

<select id="user_country" name="user[country]"><option value="1">U.S.A.</option>

nothing happens. I don't see any javascript in the html file that is generated, and no message appears when i change the country.

Any ideas?

thanks, Dino

Try changing:-

<% observe_field("user_country", :function => "alert('Element changed')") %>

to:-

<%= observe_field("user_country", :function => "alert('Element changed')") %>

Jabbslad

<sigh>

i *keep* doing this. you fixed it. thanks for the quick response.

dino.