mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-27 10:14:17 +08:00
Fix showing errors
This commit is contained in:
parent
f44404a1f8
commit
4699ba718a
1 changed files with 2 additions and 2 deletions
|
@ -154,8 +154,8 @@ function showFormErrors(modal, errors) {
|
|||
var msg;
|
||||
msg = key.charAt(0).toUpperCase() + key.slice(1) + ': ' + errors.protocol[key].join(', ');
|
||||
if ((input.length > 0) && (errors.protocol[key].length > 0)) {
|
||||
input.parent().next('span.help-block').html(msg);
|
||||
input.parent().parent().addClass('has-error');
|
||||
input.closest('.form-group').children('span.help-block').html(msg);
|
||||
input.closest('.form-group').addClass('has-error');
|
||||
} else if (errors.protocol[key].length > 0) {
|
||||
modal.find('.general-error > span').append(msg + '<br/>');
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue