<script language="javascript" type="text/javascript">
//只允许录入数据字符 0-9 和小数点
function onlyNumber(objTR)
{
var txtval=objTR.value;
var key = event.keyCode;
if((key >= 48 && key <= 57) || key == 46)
return true;
else
event.returnValue=false;
}
</script>
<input type="text" ID="TextBox1" onKeypress="onlyNumber(this);">
//只允许录入数据字符 0-9 和小数点
function onlyNumber(objTR)
{
var txtval=objTR.value;
var key = event.keyCode;
if((key >= 48 && key <= 57) || key == 46)
return true;
else
event.returnValue=false;
}
</script>
<input type="text" ID="TextBox1" onKeypress="onlyNumber(this);">
在其它机子上行,但在我自己这台就没反应!
搞半天都不知道什么原因