For toggling update "divs" in form_remote_tag on condition!

Hi,
I have an issue in updating two divs base on the condition. Like if I
submit with the submit button it needs to update the div “div_main_data”
and on change of one select option it needs to update another div call
“div_top_data”.

<%= form_remote_tag( :update => “div_main_data”, :url => { :action =>
:change_top_view }) %>

<%= options = @categories_hash
select(:category_view,:name,options, {:include_blank => false,:selected
=>@selected_category_id},
{:onChange =>‘this.form.onsubmit()’ }) %>

<%= submit_tag(“Go”)%>

Please let me know if anyone knows how to solve this .

Thanks,
Joshua