您现在的位置是:首页 > 电脑技术查询 > web开发

再线等,解决就结贴。怎么实现text框一输入2位,光标自动进入到下一个控件

编辑:chaxungu时间:2022-10-02 23:17:24分类:web开发

再线等,解决就结贴。如何实现text框一输入2位,光标自动进入到下一个控件
如何实现text框一输入2位,光标自动进入到下一个控件,表里面有多行,并且控件名称相同。如下所示

<table>
<tr>
<td>
<input type= "text " name= "go_timeh " maxlength= "2 " value= " ">
<input type= "text " name= "go_timem " maxlength= "2 " value= " " >
</td>
<td>
<input type= "text " name= "leav_timeh " maxlength= "2 " value= " " >
<input type= "text " name= "leav_timem " maxlength= "2 " value= " " >
</td>
</tr>
<tr>
<td>
<input type= "text " name= "go_timeh " maxlength= "2 " value= " ">
<input type= "text " name= "go_timem " maxlength= "2 " value= " " >
</td>
<td>
<input type= "text " name= "leav_timeh " maxlength= "2 " value= " " >
<input type= "text " name= "leav_timem " maxlength= "2 " value= " " >
</td>
</tr>
</table>

最好定位下一个控件的时候写成动态的,按照tabindex就好了
谢谢大家。

------解决方案--------------------
mark
=============

onkeyup 监听
focus 执行
------解决方案--------------------
google.com