$(() => { $.valHooks.input = { get: function(elem) { return elem.value; }, set: function(elem, value) { var tmp = elem.value; elem.value = value; if ('item_description' === elem.id && tmp !== value) { reloadPopup(elem.form, 'popup.triggerexpr'); } } }; $('#function-select').on('change', (e) => { var form = e.target.closest('form'), function_name_parts = form.elements.function_select.value.split('_'); form.elements.function.value = function_name_parts[1]; reloadPopup(form, 'popup.triggerexpr'); }); });