<script language="javascript">
function CheckMyForm()
{
var txt = myform.mytext.value;
if(checknumber(txt))
{
alert("只允许输入数字!");
return false;
}
return true;
}
function checknumber(String)
{
var Letters = "1234567890";
var i;
var c;
for( i = 0; i < String.length; i ++ )
{
c = String.charAt( i );
if (Letters.indexOf( c ) ==-1)
{
return true;
}
}
return false;
}
</script>