ソースを参照

remote validator: Add error handler for failed Ajax request

phuoc 12 年 前
コミット
5e6c9ffb46
1 ファイル変更2 行追加3 行削除
  1. 2 3
      src/js/validator/remote.js

+ 2 - 3
src/js/validator/remote.js

@@ -28,10 +28,9 @@
                 data: data
             }).success(function(response) {
                 var isValid =  response.valid === true || response.valid === 'true';
-                if (!isValid) {
-                    validator.showError($field, 'remote');
-                }
                 validator.completeRequest($field, 'remote', isValid);
+            }).error(function(response) {
+                validator.completeRequest($field, 'remote', false);
             });
             validator.startRequest($field, 'remote', xhr);