Well, it makes some sense because when the jquery code is initially run the form it's supposed to bind to isn't there.
So what now?
Answer, .live(), coffescript:
$ -> $("#my_id").live 'change', ->
if(this.checked)
$("#other_id").show()
else
$("#other_id").hide()
This makes the jquery goodness bind to all current and future instances with the given id. Now the form that is loaded by user interaction has it's javascript functioning.
No comments:
Post a Comment