如何限制用户输入的是数字,进来看看,有3种格式 you can use javacript and ascill to check the input, find the example in the www.codeproject.com, it's very useful!good luck! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 function keyPressFlt(src){ var e=window.event; code=e.keyCode; if(code >=48 && code <=57) return true; else if(code == 46 && src.value.indexOf('.')==-1) return true; else{ window.event.keyCode=null; return false; }}不够健全,自己改改就可以了还要处理onpaste事件,ondrag事件的 <input type="text" onkeypress="return event.keyCode<=57 && event.keyCode>=48" onpaste="return clipboardData.getData('text').match(/^\d+$/gi)!=null" style="ime-mode:disabled" ondragenter="return false" value=""> 获取动态添加层的高度 帮忙看看这段JS在火狐下为什么不能用,怎么改,才能兼容火狐 js如何多行只读? fck 编辑器 怎么用JS修改CSS文件里面的元素? 页面中已经包含了要使用的js文件,为什么不起作用?? Higcharts柱线图怎么才能让两边的y轴数据互换位置? 100分请教大家两个问题~!!!问题解决后我会立刻结帐~~~!!! 这是一个"确定取消"的例子,谁能帮我解决这个问题??? 一个prototype的问题。。 【FAQ 光标操作小结】 取得多行文本框的选定的内容
var e=window.event;
code=e.keyCode;
if(code >=48 && code <=57) return true;
else if(code == 46 && src.value.indexOf('.')==-1) return true;
else{ window.event.keyCode=null; return false; }
}
不够健全,自己改改就可以了
还要处理onpaste事件,ondrag事件的
onkeypress="return event.keyCode<=57 && event.keyCode>=48"
onpaste="return clipboardData.getData('text').match(/^\d+$/gi)!=null"
style="ime-mode:disabled"
ondragenter="return false" value="">