FIX_VALIDATION
This commit is contained in:
parent
3b3e52f874
commit
e591ada844
@ -21,6 +21,11 @@
|
|||||||
.is-invalid {
|
.is-invalid {
|
||||||
border-color: #dc3545 !important;
|
border-color: #dc3545 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Avoid duplicate validation messages: keep custom .field-error only */
|
||||||
|
#insurer_branch_form .parsley-errors-list {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
<!-- Optional CSS -->
|
<!-- Optional CSS -->
|
||||||
<style>
|
<style>
|
||||||
@ -495,8 +500,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getErrorElement($field) {
|
function getErrorElement($field) {
|
||||||
var $next = $field.next('.field-error');
|
var $group = $field.closest('.form-group');
|
||||||
if ($next.length) return $next;
|
var $existing = $group.find('.field-error');
|
||||||
|
|
||||||
|
if ($existing.length) {
|
||||||
|
if ($existing.length > 1) {
|
||||||
|
$existing.slice(1).remove();
|
||||||
|
}
|
||||||
|
return $existing.first();
|
||||||
|
}
|
||||||
|
|
||||||
var $error = $('<small class="field-error"></small>');
|
var $error = $('<small class="field-error"></small>');
|
||||||
$field.after($error);
|
$field.after($error);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user