Validation code was skipped by esc/ctrlenter hotkeys.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 30 Oct 2010 13:32:54 +0000 (13:32 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sat, 30 Oct 2010 13:32:54 +0000 (13:32 +0000)
js/inserts.js

index b9564ed98491906f9914c57de504048357590bc5..a1e1e5eae85bd094ec304767a78496cf7a32fc56 100644 (file)
@@ -427,11 +427,13 @@ function setHotKeys() {
                                                return false;
                                        }
                                        if (((asp && asp.indexOf('default') !== -1) && key==13)||((asp && asp.indexOf('cancel') !== -1) && key==27)) {
-
-                                               if (asp.indexOf('process') !== -1)
-                                                       JsHttpRequest.request(el, null, 60000);
-                                               else
-                                                       JsHttpRequest.request(el);
+                                               var func = _validate[el.name];
+                                               if (func==undefined || func()) {
+                                                       if (asp.indexOf('process') !== -1)
+                                                               JsHttpRequest.request(el, null, 60000);
+                                                       else
+                                                               JsHttpRequest.request(el);
+                                               }
                                                ev.returnValue = false;
                                                return false;
                                        }