Updating two divs based on condition

Hi,

I need to update “div_main_data” on click of one submit button and I
need to update “div_member” on change of one select option within the
same form_remote_tag. But couldn’t find any solution at the moment.

If I use -> nChange =>‘this.form.onsubmit()’
this update the whole “div_main_data” as I couldn’t toggle the update
parameter
in form_remote_tag.

And if I use ->
nchange => remote_function(:update => ‘div_member’,
:url => { :action => ‘change_top_view’ })
It does submit the team member parameter in the request object.

please please suggest me with any idea.

CODE SNIPPET:

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

<%=
options = @team_hash
select(:team_view,:name,options, {:include_blank => false,:selected
=>@selected_team_id},
{nChange =>‘this.form.onsubmit()’ }) %>

<%=
options = @member_hash
select(:member_view,:name, options, {:include_blank => false,:selected
=>@selected_member_id}) %>

<%= submit_tag(“Go”)%>
<%= end_form_tag %>
================================================== =

Thanks in advance
josh

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs