<html>
<head>
<script language=javascript>
function validate()
{
var str=document.all.TextBox1.value;
var intValue=parseInt(str); if (!isNaN(intValue))
{
if(intValue>=3 && intValue<=6)
{
return true;
}
alert("range error");
return false;
}
alert("not number");
return false;
} </script>
</head>
<form id=f1>
<body>
<input name="TextBox1">
<input type=submit onclick="return validate();">
</body>
</form>
</html>
<head>
<script language=javascript>
function validate()
{
var str=document.all.TextBox1.value;
var intValue=parseInt(str); if (!isNaN(intValue))
{
if(intValue>=3 && intValue<=6)
{
return true;
}
alert("range error");
return false;
}
alert("not number");
return false;
} </script>
</head>
<form id=f1>
<body>
<input name="TextBox1">
<input type=submit onclick="return validate();">
</body>
</form>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货