谢谢
1 个解决方案
#1
<script language="JavaScript">
<!--
function keyPress()
{
var ch=String.fromCharCode( window.event.keyCode );
var reg=new RegExp("[0-9a-f]","i");
if(reg.test(ch)) return true;
else{
window.event.returnValue=false;
return false;
}
}
//-->
</script>
<input type="text" onkeypress="keyPress()" size="20">
<!--
function keyPress()
{
var ch=String.fromCharCode( window.event.keyCode );
var reg=new RegExp("[0-9a-f]","i");
if(reg.test(ch)) return true;
else{
window.event.returnValue=false;
return false;
}
}
//-->
</script>
<input type="text" onkeypress="keyPress()" size="20">
#1
<script language="JavaScript">
<!--
function keyPress()
{
var ch=String.fromCharCode( window.event.keyCode );
var reg=new RegExp("[0-9a-f]","i");
if(reg.test(ch)) return true;
else{
window.event.returnValue=false;
return false;
}
}
//-->
</script>
<input type="text" onkeypress="keyPress()" size="20">
<!--
function keyPress()
{
var ch=String.fromCharCode( window.event.keyCode );
var reg=new RegExp("[0-9a-f]","i");
if(reg.test(ch)) return true;
else{
window.event.returnValue=false;
return false;
}
}
//-->
</script>
<input type="text" onkeypress="keyPress()" size="20">