javascript - Dynamically added select change events not registering -
in site have code follows: -
$(function() { $(document).on('change', 'select', function() { var formid = $(this).attr("id"); if((formid.indexof("forms[")>-1)){ var newformid= $(this).val(); var scenarioid = ${testscenarioinstance?.id} getforminformation(newformid, "forms", $(this), scenarioid); } }); });
in part of page user can add additional selects via simple little post , append. trouble newly added selects piece of code doesn't trigger, works fine select there when page loads. ideas why is?
it should work have now, here made little example same code event:
$(document).on('change', 'select', function () { alert("works well"); });
Comments
Post a Comment