I have a little trouble:
I've tried:
autofocus
.focus()
setTimeOut
But the results got same:
I've set ActiveForm::begin(['validateOnBlur' => false]) but got same result and not showing helpblock, input still unfocus after 1s.
ActiveForm::begin(['validateOnBlur' => false])
What should I do now? Thank you!
Solved, may other people need:
$('#ajaxCrudModal').on('shown.bs.modal', function() { $("#mauxetnghiemvitri-code").focus(); });
you should add some delay for focus event
$('#ajaxCrudModal').on('shown.bs.modal', function() { setTimeout(function(){ $("#mauxetnghiemvitri-code").focus(); },1000) });
2.1m questions
2.1m answers
60 comments
57.0k users