Form_remote_tag ISSUE!

Hi frenz,
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. But couldn’t
find any solution at the moment.

If I use -> :onChange =>‘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 ->
:onchange => remote_function(:update => ‘div_member’,
:url => { :action => ‘change_top_view’ })
It does submit the team member parameter in the request object.

please please rescue me.

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},
{:onChange =>‘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 a lot in advance
josh

Hi Josh,

joshua asem wrote:

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.

I think you should take a look at using RJS. I recommend Cody F.'s
‘RJS
Templates for Rails’ which you can find at
http://www.oreilly.com/catalog/rjsrails/index.html It’s well worth the
$10.

hth,
Bill

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