jquery focus back to the same input field on error not working on all browsers

前端 未结 1 1674
难免孤独
难免孤独 2021-01-27 03:19

I have a form with multiple fields which has both dynamically created fields and some pre defined fields. one of the field uses a jquery timepicker plugin courtesy of http://jo

相关标签:
1条回答
  • 2021-01-27 03:54

    It is an implementation bug in Firefox and IE, you can solve it using a timer. This is the new fiddle: http://jsfiddle.net/8cL42bcy/8/

    I've added setTimeout(function() { $('#field').focus(); }, 50); at the end.

    It will not affect Chrome in any way, because there is already focused.

    0 讨论(0)
提交回复
热议问题