idnumber条目,可在文本框上自动添加连字符 [英] idnumber entry that automatically adds hyphen on textbox

查看:163
本文介绍了idnumber条目,可在文本框上自动添加连字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试单独使用reg ex,但是它只能检查它是否遵循格式,并且我想通过自动添加连字符来寻求一种更好的方式来从用户那里获取输入.

我的reg前:\ b \ d {2}-\ d {9}-\ d {1}

任何2位数字-任何9位数字-任何1位数字

i have tried using reg ex alone but it can only check if it followed the format and I want a better way of getting input from user by automatically adding hyphen.

my reg ex: \b\d{2}-\d{9}-\d{1}

any 2digit-any 9digit-any 1digit number

推荐答案

其他,然后使用Ajax的Masked文本框,您还将发现这个简单的
Other then Masked textbox using Ajax, You will also find this simple TRICK[^] with simple JS useful.


尝试MaskedEdit ASP.Net AJAX扩展程序 [ ^ ]或其他一些带遮罩的文本框控件.
Try the MaskedEdit ASP.Net AJAX extender[^] or some other masked text box control.


您可以查看和自定义的另一个带遮罩的文本框自定义控件:Xtended文本框 [ ^ ]
Another, masked textbox custom control that you can look at and customize: Xtended TextBox[^]


这篇关于idnumber条目,可在文本框上自动添加连字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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