- 注册时间
- 2014-7-21
- 最后登录
- 2022-7-26
- 阅读权限
- 150
- 积分
- 18264
- 精华
- 0
- 帖子
- 8338
|
我们没有禁止输入,需要外部绑定jquery事件来处理- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title></title>
- <script src="http://www.miniui.com/scripts/boot.js" type="text/javascript"></script>
- </head>
- <body>
- <input onkeyup="this.value=this.value.replace(/\D/g,'')" onafterpaste="this.value=this.value.replace(/\D/g,'')">
- <input class="mini-textbox" id="sp1" />
- </body>
- </html>
- <script type="text/javascript">
- mini.parse();
- var sp1 = mini.get("sp1");
-
- var el = sp1._textEl;
- el.onkeyup = function () {
- this.value = this.value.replace(/\D/g, '')
- }
- el.onafterpaste = function () {
- this.value = this.value.replace(/\D/g, '')
- }
- </script>
复制代码 |
|