English 中文(简体)
电话号码 方框
原标题:Phone Number TextBox issue

电话号码有三条<密码>。 <代码>Text Box1 max length is 3,2nd s max length is 3 and 3rd max length is 4. 用户类型 3 位数,TextBox1 <代码>cursor transports natural to TextBox2 same mece with TextBox2 as well as textBox3. 我在<代码>keyup活动中处理这一功能。

“entergraph

问题在我新闻时

Ctl+a

Ctl+c

Ctl+v

曲线自动移至“条码”>Text Box3 ,因为“条码>Text Box 上载至“条码”>Max Length ,并将其移至“条码>。 我想将其保留在“条码”上。 任何想法?

My code is below.

<asp:TextBox runat="server" ID="tbPh2" MaxLength="3" onkeyup="Mainautotab2(this, 0, event);"/>
<asp:TextBox runat="server" ID="tbPh22" MaxLength="3" onkeyup="Mainautotab2(this, 1, event);"/>
<asp:TextBox runat="server" ID="tbPh222" class="midium" MaxLength="4" />


function Mainautotab2(original, destination, evt) {
         if (document.getElementById( <%= tbPh2.ClientID%> ).value.length == 3 && document.getElementById( <%= tbPh22.ClientID%> ).value.length == 3) {

         if (destination == 0)
             document.getElementById("<%=tbPh22.ClientID %>").focus();
         if (destination == 1)
             document.getElementById("<%=tbPh222.ClientID %>").focus();
     }
}
最佳回答
问题回答

不要使用OnKeyUp活动。 文本箱的改动和案文框的长度





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签