head部分
yg_id为判断字段
<head>
<title>新增</title>
<script language="javascript">
function checkYgId() {
if (myForm.yg_id.value != "") {
return true
} else {
alert("不能为空");
return false
}
}
</script>
<%--select count(*) from table where no = ?--%>
</head>
from表单部分
<form action="${pageContext.request.contextPath}/demoAction" name="myForm" onSubmit="return checkYgId()">
<table width="380px" border="1px" align="center">