N°2847 Lighter error display on inputs firts validation

Note: Doesn't work with tagsets and enumsets
This commit is contained in:
Stephen Abello
2020-10-30 10:13:34 +01:00
parent c43d52277c
commit a70ed7fcc2
3 changed files with 14 additions and 8 deletions

View File

@@ -215,8 +215,14 @@ function ReportFieldValidationStatus(sFieldId, sFormId, bValid, sExplain)
// Let's remember the first input with an error, so that we can put back the focus on it later
oFormErrors['input_'+sFormId] = sFieldId;
}
// TODO 3.0 Maybe use data role ?
$('#field_'+sFieldId+' .ibo-input-wrapper').addClass('is-error')
if($('#field_'+sFieldId+' .ibo-input-wrapper').attr('data-validation') === 'untouched') {
$('#field_'+sFieldId+' .ibo-input-wrapper').removeAttr('data-validation');
}
else{
$('#field_'+sFieldId+' .ibo-input-wrapper').addClass('is-error');
}
if ($('#v_'+sFieldId).text() == '')
{
$('#v_'+sFieldId).html(sExplain);