为什么无法在输入错误下弹出串口报错,新人,求帮住
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language=javascript>
function account(i) {
yname="yuwen"+i ;
sname="shuxue"+i ;
ename="yingyu"+i ;
yuwen=parseInt(document.myform[yname].value);
if (isNaN(yuwen))
{
alert("请输入正确的语文分数!");
return false ;
}
shuxue=parseInt(document.myform[sname].value);
if (isNaN(shuxue))
{
alert("请输入正确的数学分数!");
return false ;
}
yingyu=parseInt(document.myform[ename].value);
if (isNaN(yingyu))
{
alert("请输入正确的英语分数!");
return false ;
}
}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
</head>
<body>
<form method="POST">
<table border="1" width="100%" id="table1" cellspacing="0" cellpadding="0">
<tr><td width="20%" align="center"><b>姓名</b></td>
<td width="20%" align="center"><b>语文</b></td>
<td width="20%" align="center"><b>数学</b></td>
<td width="20%" align="center"><b>英语</b></td>
</tr>
<tr><td width="20%" align="center"><b>小绿</b></td>
<td width="20%"><input type="text" name="yuwen1" size="20" onchange='account(1)'></td>
<td width="20%"><input type="text" name="shuxue1" size="20" onchange='account(1)'></td>
<td width="20%"><input type="text" name="yingyu1" size="20" onchange='account(1)'></td>
<td width="20%"id="sum1"></td>
</tr>
<tr><td width="20%" align="center"><b>小明</b></td>
<td width="20%"><input type="text" name="yuwen2" size="20" onchange='account(2)'></td>
<td width="20%"><input type="text" name="shuxue2" size="20" onchange='account(2)'></td>
<td width="20%"><input type="text" name="yingyu2" size="20" onchange='account(2)'></td>
</tr>
<tr><td width="20%" align="center"><b>小花</b></td>
<td width="20%"><input type="text" name="yuwen3" size="20" onchange='account(3)'></td>
<td width="20%"><input type="text" name="shuxue3" size="20" onchange='account(3)'></td>
<td width="20%"><input type="text" name="yingyu3" size="20" onchange='account(3)'></td>
</tr>
</table>
</form>
</body>
</html>
------解决方案--------------------
<form method="POST" name="myform">