Another simple solution is to use event listener on
instead of change
.
Then the JS code is like this:
$(document).ready(function() {
$('select.auto_update').on('change', (function(){
...
$(this).closest("form").submit(); // never triggered on newly loaded markup
});
});
Two changes:
on
to replacechange
- submit the form but not selector.
This way your event will always live, save your cumbersome to build custom function for ready
.