tabindex的使用方法就是
tabindex="1"
为了让大家看起来方便,你简化了代码,HTML输入框代码如下:
没有加tabindex时的代码:
<input name="b_username" type="text" id="b_username"/>
<input name="code" type="text" id="code" size="20"/>
<input type="button" style="background-image:url(images/bbsImg_11.gif); width:90px; height:34px; margin:0px; padding:0px; border:0px;" οnclick="return uLogin();"/>
<input name="b_password" type="password" id="b_password" size="20"/>
加tabindex时的代码:
<input name="b_username" type="text" id="b_username" tabindex="1"/>
<input name="code" type="text" id="code" size="20" tabindex="3"/>
<input type="button" style="background-image:url(images/bbsImg_11.gif); width:90px; height:34px; margin:0px; padding:0px; border:0px;" οnclick="return uLogin();" tabindex="5"/>
<input name="b_password" type="password" id="b_password" size="20" tabindex="2"/>
看到没有,每个输入框的后面都加了tabindex="一个数字",这样在用tab键跳转时,就会以你输写的顺序了。
注:在ExtJS里只需要在EclipseJSde 的设计窗口选择所要按顺序跳转的控件,将其属性TanIndex填入对于的数字即可。