文本框仅接受一位或两位数 [英] textbox accept only one digit or two digit

查看:86
本文介绍了文本框仅接受一位或两位数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文本框,该框只能比允许的位数多1位或2位....仅数字

请为此提供一些有关Jquery的帮助


谢谢

i have text box that shoul allow only tow 1 digit or 2 digit more than that it should allow .... only numbers

please some one help for Jquery for this


Thanks

推荐答案

可以尝试使用任何正则表达式吗?
您可以根据需要将文本框内容与文本框失去焦点或文本框值更改事件上的正则表达式进行匹配.

请将此正则表达式与jquery或javascript一起使用以验证您的文本框.

Can you tried any regular expression.
you can match the text box content with regular expression on textbox lost focus or text box value chnage event as per your requirement.

please use this regular expression with jquery or javascript to validate your text box.

^\d{1}


| ^ \ d {
|^\d{2}




有关jquery正则表达式的更多信息,请参见此链接
http://www.9lessons.info/2010/01/jquery-validation-with- normal.html [^ ]



for more information on jquery regular expression please see this link
http://www.9lessons.info/2010/01/jquery-validation-with-regular.html[^]


这篇关于文本框仅接受一位或两位数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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