Hi I have the field Category, SubCategory, and ProductType in select boxes When a category is selected corresponding subcategory is selected and its corresponding product type is to be selected..But i have when a category selected subcategory selected and its produt type selecetd for first time..But after observerfield update div as follow my product type not updated code as below Category <%= select( "sd_ticket", "service_desk_category_id", ServiceDeskCategory.find(:all).collect {|p| [ p.name, p.id ] }) %>
Subcategory <div id = "sub_category_container"><%= select( "sd_ticket", "service_desk_sub_category_id", ServiceDeskSubCategory.find(:all, :conditions => ["service_desk_category_id =?", 1] ).collect {|p| [ p.name, p.id ] }) %> </div>
<%= observe_field("sd_ticket_service_desk_category_id", :update => "sub_category_container", :url => { :controller => :popup, :action => :prepare_sub_category }, :method => "post", :with => "'category_id='+value") %>
Product type <div id = "product_type_container"><%= select( "sd_ticket", "service_desk_product_type_id", ServiceDeskProductType.find(:all, :conditions => ["service_desk_sub_category_id =?", 1] ).collect {|p| [ p.name, p.id ] }) %></div>
<%= observe_field("sd_ticket_service_desk_sub_category_id", :update => "product_type_container", :url => { :controller => :popup, :action => :prepare_product_type }, :method => "post", :with => "'sub_category_id='+value") %>
In the controller with rjsthe div is replaced with same code Please help Sijo