From 70408d1f63013d5175d85c6adca1ad78f18308ce Mon Sep 17 00:00:00 2001 From: mzd Date: Fri, 2 May 2014 17:11:21 -0400 Subject: [PATCH] CRM-14353 fix for changed fields check not being disabled on submit ---------------------------------------- * CRM-14353: Fix formNavigate to work with multiple forms & ajax https://issues.civicrm.org/jira/browse/CRM-14353 --- js/Common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/Common.js b/js/Common.js index 2818abc18c..4b0ec52773 100644 --- a/js/Common.js +++ b/js/Common.js @@ -510,12 +510,12 @@ CRM.validate = CRM.validate || { }) .on('submit', function(e) { // CRM-14353 - disable changes warn when submitting the form - $(this).removeAttr('data-warn-changes'); + $('[data-warn-changes]').removeAttr('data-warn-changes'); }) ; window.onbeforeunload = function() { - if (CRM.utils.initialValueChanged($('form[data-warn-changes]'))) { + if (CRM.utils.initialValueChanged($('form[data-warn-changes=true]'))) { return ts('You have unsaved changes.'); } }; -- 2.25.1