Jquery – catch change events of dynamically added controls

If you dynamically add controls with ajax, javascript doesn’t see those controls unless you hang the method on the document.body like this:

$(document.body).on(‘keyup change blur’,
‘.dateTaken’,
function (event) {
enableOrDisableSaveButton();
});

This watches keyup, change, and blur on an element that has the class dateTaken.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.