ruby on rails - Can't find DOM element in jQuery -



ruby on rails - Can't find DOM element in jQuery -

i'm going insane. take @ fiddle: http://jsfiddle.net/ndh9g/4/

it's relevant code rails site i'm working on (for fantasy football). every time "type" select changed, want reset "direction" select "select" cutting downwards on wonkiness happens if type changed after fields filled in.

except can't.

no matter do, cannot access stupid "direction" select. if look, you'll see these 2 lines:

$('div', location).next('.player-trade-fields').hide(); $('div', location).next('.terms-field').show();

and coming shock no one: work should without issue. when seek access "direction" select @ same dom level 2 fields:

$('div', location).next('.trade-direction')

i nothing. have alert in there show me if value beingness returned , absolutely nil returns value. don't it. don't how jquery not find it. i've tried:

location.next selectbox.next $('div', selectbox).next $('div', selectbox.parent()).next $('div', selectbox.parent().parent()).next $('div', selectbox.parent().parent().parent()).next $('div', selectbox.parent().parent().parent().parent()).next

nothing works. cannot select no matter , after 2 hours of time wasted on that, far can tell, should working without issue much code fields @ same level is, give up.

please show me whatever obvious thing i've overlooked is.

figured out. changed to:

$('div', location).find('.trade-direction')

and it's working should , isn't interfering when there multiple instances of form on page added through ajax.

jquery ruby-on-rails

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -