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) });
1.4m articles
1.4m replys
5 comments
57.0k users