I've had this problem in the past when dynamically creating elements that needed event listeners binded to them, this is what you need to do:
$(document).on("event", "#selector", function(){
//Your code here
});
Binding to the document will allow all dynamic events to be triggered properly. Just change the event to what you need and the selector you need as well and it'll work.