<HTML>
<HEAD>
<script language="javascript">
function check()
{
var flag=true;
var text2=document.form1.text1.value
if (isNaN(text2)||text2.length==0)
{
alert("请输入数字");
flag=false;
}
else
{
var text3=Number(text2)
if (text3<=0||text3>=100)
{
alert("输入的数字必须大于0小于100");
flag=false;
}
}
return flag;
}
</script>
</HEAD>
<BODY>
<form name="form1" onsubmit="return check()">
<input type="text" name="text1">
<input type="submit" value="确定">
</form>
</BODY>
</HTML>
[此贴子已经被作者于2005-6-12 10:17:49编辑过]