Cascading dropdown w Ajax

I am using 2 dropdown selections DDA and DDB in a form

I use a Ajax observe_field on DDA to change DDB , working fine…

<%= observe_field (‘DDA’,
:url => {:action => ‘DDA_selected’},
:with => “‘id=’+value”) -%>

–in controller
def DDA_selected
render :update do |page|
page.replace_html ‘DDBBox’, :partial => ‘DDBbox’
end
end

I tried to use another observe_field on DDB to show a div, but nothing
happen when selecting an option in DDB

<%= observe_field (‘DDB’,
:url => {:action => ‘DDB_selected’},
:with => “‘id=’+value”) -%>

–in controller
def DDB_selected
render :update do |page|
page.show ‘part2form’
end
end

On Oct 8, 8:14 am, Kad K. [email protected]
wrote:

render :update do |page|

–in controller
def DDB_selected
render :update do |page|
page.show ‘part2form’
end
end


Posted viahttp://www.ruby-forum.com/.

Does DDB exist at the time the observer is created?

_Kevin

_Kevin wrote:

On Oct 8, 8:14 am, Kad K. [email protected]
wrote:

render :update do |page|

–in controller
def DDB_selected
render :update do |page|
page.show ‘part2form’
end
end


Posted viahttp://www.ruby-forum.com/.

Does DDB exist at the time the observer is created?

_Kevin

You gave me a clue … thanks a lot !!!

when page.replace_html ‘DDBBox’, :partial => ‘DDBbox’ is performed… I
forgot to write ALSO in the DDBbox partial the observe_field…

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