日期:2014-05-18  浏览次数:20496 次

有4个textbox想实现第一个输入内容后自动把焦点放到第二个textbox里,依次类推,还没解决,下面的程序不起作用
有4个textbox想实现第一个输入内容后自动把焦点放到第二个textbox里,依次类推,还没解决,下面的程序不起作用

    function   haddleEnter()
        {
          var   i=(document.getElementById( 'shitxt ').value).Length;
                     
                if(i==2)
              {  
                 
                        document.getElementById( 'fentxt ').focus();
                                                            }
        }

------解决方案--------------------
<asp:TextBox ID= "shitxt " runat= "server " MaxLength= "2 " onkeydown= "javascript:shinext(this) "> </asp:TextBox>

function shinext(obj)
{
if(event.keyCode==8)return;
if(obj.value.length==2)
{
document.getElementById( "fentxt ").focus();
}
}

其余类推