Get value of select whch change using ajax after form submit

Hi All,
I have a problem while updating select list using ajax and then submit
it.
what i have done is to change the drop down of a city when i changed
the state.but when i am submitting the form i am not able to get the
value of city.
Following is my code for the same.

edit.html.erb
<% form_for :user_info , :url=>{:controller=>“users”,
:action=>“update_contact_details”,:id=>params[:id] } do |f| %>

 <% @state= UsaCity.find_by_sql('select DISTINCT state from

usa_cities’) %>

       <td >State</td>

       <td> <%= select_tag 'user_info[state]',

options_from_collection_for_select(@state, :state, :state,
@user_info.state) %>




<%= observe_field :user_info_state, :url
=>{:controller=>“logins”,:action =>‘select_city’, :id=>‘1’}, :update=>
‘city’ , :with => “’
state=’+document.getElementById(‘user_info_state’).value+’&type=contact_details’”,
:on=>‘click’ %>
    </tr>
   <tr id="city">

    <td >City</td>

   <td><%= collection_select :user_info, :city,  @cities ||

Array.new, :city, :city, :prompt=>true %>

    </tr>

<% end %>

controller method
def edit_city
@cities = UsaCity.find(:all, :conditions=>[“state=?”,
params[:state]])
@type = params[:type]
render :update do |page|
page.replace_html ‘city’, :partial => ‘logins/select_city’,
:object=>[@cities, @type], :layout => false
end
end

_select_city.html.erb

City1345 <%= collection_select :user_info, :city, @cities || Array.new, :city, :city, :prompt=>true %>

Regards,
Salil G.

Hi All,

Sorry for this but it’s not working properly because i use form_for tag
inside the

tag.
i only remove form from inside the table and keep outside the table tag
and now everything is works like a magic. I hope this will help someone
to save his/her 1 hr or 2.

Regards,

Salil G.