我有一个表单,我有数据选择器,select2(自定义下拉搜索)和许多输入,文本区域字段,当我按Tab键移动下一个字段工作正常,但下一个字段是日期选择器或select2然后选项卡索引不起作用我想要一般解决方案和所有浏览器。 目前我正在做静态解决方案,比如获得一个div的id然后Prop标签索引为1个值。
This is an inactive AAA product. It will be replaced by replacement AAAA/BBBB number ABX16059636/903213712 during quoting
答案 0 :(得分:1)
你应该得到id select2 ID然后在关闭事件时将焦点引用到下一个字段。
$('#currentDiv').select2().on("select2:close", function (e) {
$('#nextDiv').focus()
});
和日期选择器
$('#ID').datepicker({
onSelect: function(dateText, inst) {
$('#nextIDdiv').focus();
}
});
并且对于简单的输入字段选项卡工作正常。