Prevent bugs in form validation from messing up the entire page
@@ -548,7 +548,14 @@ function registerValidator(e) {
FormChecker.sendRequest(this.targetUrl(), {
method : method,
onComplete : function(x) {
+ if (x.status == 200) {
+ // All FormValidation responses are 200
target.innerHTML = x.responseText;
+ } else {
+ // Content is taken from FormValidation#_errorWithMarkup
+ // TODO Add i18n support
+ target.innerHTML = "<div class='error'>An internal error occurred during form field validation (HTTP " + x.status + "). Please reload the page and if the problem persists, ask the administrator for help.</div>";
+ }
Behaviour.applySubtree(target);
}
});
