[FO] 수정 : 52. 필수 입력 사항을 입력하지 않은 경우, 입력하지 않은 란을 포커스되도록 변경
This commit is contained in:
@@ -172,7 +172,7 @@ kri.form.errorInit = function (formElement) {
|
||||
if (formElement.length > 0) {
|
||||
$(formElement).find('.component-input').removeClass('input-invalid');
|
||||
$(formElement).find('.input-flex-group').removeClass('invalid');
|
||||
$(formElement).find('.select-group').removeClass('select-invalid');
|
||||
$(formElement).find('.select-group').removeClass('input-invalid');
|
||||
$(formElement).find('.input-info').each(function () {
|
||||
$(this).remove();
|
||||
});
|
||||
@@ -238,11 +238,12 @@ kri.form.error = function(errorList){
|
||||
}
|
||||
});
|
||||
|
||||
if(errorList && errorList.length > 0){
|
||||
const target = $('[name="' + errorList[0].field + '"]');
|
||||
if (target.length > 0) {
|
||||
target.focus();
|
||||
}
|
||||
// 포커스 이동
|
||||
if ($('.input-invalid').length != 0) {
|
||||
$('.input-invalid').eq(0).find('input').focus();
|
||||
}
|
||||
if ($('.select-invalid').length != 0) {
|
||||
$('.select-invalid').eq(0).find('button').focus();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user