一位数和两位数的掩码 [英] mask for one digit and two digit

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

问题描述

我一直在使用这个$(#SomeId)。mask(99);文本框的jquery掩码,我只想输入两位数字,
但我不知道要放入哪个掩码,以便只能输入一位数和两位数。从0-99

I have been using this $("#SomeId").mask("99"); jquery mask for text box where I want to enter only two digit numbers, but i do not know which mask to put in order to enable entering only one digit number and two digit. From 0-99

带上面的掩码我不能输入一位数字,文本框在失去焦点时变为空白。

with mask above I cannot enter one digit number, the text box become blank when it lose focus.

推荐答案

{mask:9,'maxLength':2}应该有效

{mask: 9, 'maxLength': 2} should work

编辑:你还没有说明你用过的面具;我的回答与 meioMask 插件有关。

you have not specified what mask have you used; my answer is related to meioMask plugin.

编辑2: for maskedinput 1.2.2:

Edit 2: for maskedinput 1.2.2:

$("#SomeId").mask("9?9");

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

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