Set Value of text_field after onchange


I have a text field which is :

<%= text_field( "select", "name" ,{:onchange => "this.form.submit();"} ) %>

I want to search database using value entered by user, and when search results are displayed, I want to have text field retailn the value which was entered to have search results.

I did something like this,

<% eventname = params[:select_name]%>   <%if eventname!=nil%>     <% = eventname %>     <% end %>

Still, it does not contain that value which user entered.

Can anyone help please?

Thanks very much, Pat

Take a look at development.log (or if you've just done ruby script/ server, the output will be in that window too). The log shows you the params hash for each request. You should be able to work it out from there.