Don't prompt the user that changes may not have been saved after apply clicked
var name;
for (let i = 0; i < buttons.length; i++) {
var button = buttons[i];
- name = button.parentNode.parentNode.getAttribute("name");
+ name = button.getAttribute("name");
if (name == "Submit" || name == "Apply" || name == "OK") {
$(button).on("click", function () {
needToConfirm = false;
