Skip to content

Commit 5b67d3b

Browse files
committed
Dont let server validation error message overwrite messages from other validators victorjonsson#502
1 parent 596ab45 commit 5b67d3b

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/main/jquery-plugins.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@
330330
errorMessages.push(mess);
331331
}
332332
errorInputs.push($elem);
333-
$elem.attr('current-error', mess);
333+
$elem.valAttr('current-error', mess);
334334
if (displayError) {
335335
$.formUtils.dialogs.applyInputErrorStyling($elem, conf);
336336
}
@@ -421,7 +421,7 @@
421421
$.formUtils.dialogs.setMessageInTopOfForm($form, errorMessages, conf, language);
422422
} else {
423423
$.each(errorInputs, function (i, $input) {
424-
$.formUtils.dialogs.setInlineMessage($input, $input.attr('current-error'), conf);
424+
$.formUtils.dialogs.setInlineMessage($input, $input.valAttr('current-error'), conf);
425425
});
426426
}
427427
if (conf.scrollToTopOnError) {

src/modules/security.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,9 @@
391391
$input.removeClass('validating-server-side');
392392
if (response.message) {
393393
$input.attr(conf.validationErrorMsgAttribute, response.message);
394+
$input.one('validation', function() {
395+
$input.removeAttr(conf.validationErrorMsgAttribute);
396+
});
394397
}
395398
done(response.valid);
396399
});

0 commit comments

Comments
 (0)