Web表单自动选项卡 [英] Web form auto tabbing

查看:82
本文介绍了Web表单自动选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚在桌面上放了一个网络项目,我正在使用Visual Studio 2008和C#。该表单有大约90个文本框和7个复选框,每个文本框设置为特定的最大长度。



使用if语句可以正常使用if if text length length = max length focus下一个文本框,但是长篇大论,必须有一个更有效的方式来做这个



我需要在C#中编写一个函数,这样当文本框到达它时maxlength它将自动转到下一个启用的盒子



非常感谢你的帮助



什么我试过了:



我在下一个看了几个选项,但很多都没有工作

I've just had a web project land on my desk, I'm using Visual Studio 2008 and C#. The form has approximately 90 textboxes and 7 checkboxes, each textbox is set to a specific maxlength.

It's alright using an if statement so that if textbox length = max length focus next textbox but is long winded, there has to be a more productive way of doing this

I need to write a function in C# so that when the textbox has reached its maxlength it will autotab to the next enabled box

many thanks for your help

What I have tried:

I've looked at several options on the next but many fail to work

推荐答案

我会用JQuery



你可以在客户端做得很整齐。



我没有测试过,所以可能需要调整。



I would use JQuery

You can do it quite neatly in the client.

I haven't tested it so it may need tweaking.


input [type ='text'])。ch ange( function (){
var max = parseInt
("input[type='text']").change(function() { var max = parseInt(


this )。attr( maxlength), 10 );
var len =
(this).attr("maxlength"), 10); var len =


这篇关于Web表单自动选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆