Answer the question
In order to leave comments, you need to log in
How to check the validation result on the client of a specific field in YII2?
Good afternoon. I want to show the picture the user has selected in the input file field next to this field. But only on condition that the picture has passed the built-in YII2 client-side validation. Please tell me how can I describe this condition in javascript.
if (валидация на конкретном поле пройдена ) {
вставляем картинку.
}
Answer the question
In order to leave comments, you need to log in
$('#myForm').on('afterValidateAttribute', function(event, messages) {
if(messages.length) {
alert('Ошибка валидации');
return false;
}
})
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question