不出提示过滤
<input id=aaa type=text οnkeyup="value=value.replace(/[^/d]/g,'') "onbeforepaste="clipboardData.setData('text',clipboardData.getData('text').replace(/[^/d]/g,''))" />
只能输入数字
如要输入小数的话
[^/d]/g,
改成[^/d.]/g,
<INPUT οnkeypress=check(this) id=tb1 runat="server">
<SCRIPT>
function check(e)
{
var k=window.event.keyCode;
if(k<48||k>57)
{
alert('请输入数字!');
window.event.keyCode=0;
}
}</SCRIPT>
</P>
<P>只能输入中文</P>
<SCRIPT>function onlychinese()
{
if ((window.event.keyCode >=32) && (window.event.keyCode <= 126))
{
window.event.keyCode = 0 ;
window.sp1.innerHTML=("<font color=red> *对不起,请输入中文名称</font>")}} </SCRIPT>
<FORM NAME=FRM >只能输入汉字的输入框
<INPUT ONKEYPRESS="ONLYCHINESE() " NAME=TEST>
</FORM>