zoukankan      html  css  js  c++  java
  • 在回车时将焦点转移到下一个文本框(repeater中的)

    //设置下一个焦点
            function SetNextFocus(tb)
            {
                var rowsCount = document.getElementById("txtRowsCount").value;
     
                if(event.keyCode == 13)
                {
                    if(rowsCount<10)
                    {
                        var oldnum = tb.id.substr(17,1);
                        if(oldnum < rowsCount -1)
                        {
                            var newnum = parseInt(oldnum) + parseInt("1");
                            document.getElementById("rptMonthPlan_ctl0" + newnum + "_txtMark").focus();
                        }
                        if(oldnum==rowsCount-1)
                        {
                            document.getElementById("tdMyScore").focus();
                        }
                 
                    }
                    else
                    {
                        var oldnum = tb.id.substr(17,2);
                        if(oldnum < rowsCount)
                        {
                            var newnum = parseInt(oldnum) + parseInt("1");
                            document.getElementById("rptMonthPlan_ctl" + newnum + "_txtMark").focus();
                        }
                        if(oldnum==rowsCount-1)
                        {
                            document.getElementById("tdMyScore").focus();
                        }
                    } 
                }
            }
  • 相关阅读:
    利用消息机制实现.NET AOP(面向方面编程)--通过RealProxy实现 zz
    A Taste of AOP from Solving Problems with OOP and Design Patterns (Part II) zz
    在.Net中使用异步(一)
    在.Net中使用异步(二)
    技术人员的误区(zz)
    A Taste of AOP from Solving Problems with OOP and Design Patterns (Part III) zz
    利用矩阵进行坐标系转换
    如何选择开源许可证[zz]
    .Net,你为什么会慢
    理解 Thread.Sleep 函数
  • 原文地址:https://www.cnblogs.com/newwind521/p/699538.html
Copyright © 2011-2022 走看看