CRM-14353 fix for changed fields check not being disabled on submit
authormzd <mzd@ginkgostreet.com>
Fri, 2 May 2014 21:11:21 +0000 (17:11 -0400)
committermzd <mzd@ginkgostreet.com>
Fri, 2 May 2014 21:22:57 +0000 (17:22 -0400)
----------------------------------------
* CRM-14353: Fix formNavigate to work with multiple forms & ajax
  https://issues.civicrm.org/jira/browse/CRM-14353

js/Common.js

index 2818abc18cebdc0a8b232ab486646b9f34db71d1..4b0ec5277350753a4557947967296bb0dfdffe1c 100644 (file)
@@ -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.');
        }
     };