贴出你的代码来, 我这里测试没有这个问题呀!!
<form enctype="multipart/form-data" onsubmit="alert('正常提交'); return true">
<input type=file>
<input type=reset onclick="reset()" value=reset>
<input type=submit></form>
<form enctype="multipart/form-data" onsubmit="alert('正常提交'); return true">
<input type=file>
<input type=reset onclick="reset()" value=reset>
<input type=submit></form>
<html>
<head>
<script language="javascript">
//表单数据有效性验证
function checkForm()
{
testForm.submit();
}
</script>
</head>
<body>
<form name="testForm" method="post" onsubmit="checkForm()" action="createReport.jsp" enctype="multipart/form-data">
<table width="99%" border="0" cellspacing="0" cellpadding="0" >
<tr>
<td>File:</td>
<td >
<input type="file" name="fileName" size="60"/>
</td>
</tr>
<tr>
<td nowrap colspan="2">
<input type=reset onclick="reset()" value=reset>
<input type=submit>
</td>
</tr>
</table>
</form>
</body>
</html>
1.<input type=reset value=reset> 已经是type=reset 了就没必要再加onclick
2.onsubmit="return checkForm()" 在checkForm()函数里应该是通过return true/false控制表单是否提交, 否则表单本身已提交, 你在JS脚本也以提交了.
function checkForm()
{
if(!check()) return false;//check()是校验函数,真返回true,否则返回false
return true; }
onsubmit="javascript:return checkForm()"
<input type=reset value=reset> 没有必要加onclick 事件
<html>
<head>
<script language="javascript">
//表单数据有效性验证
function checkForm()
{
testForm.submit();
}
</script>
</head>
<body>
<form name="testForm" method="post" action="createReport.jsp">
<input type="file" name="fileName">
<a href="javascript:testForm.reset()">Reset Form</a>
<input type="button" onclick="checkForm()" value="Check">
</form>
</body>
</html>
<html>
<head>
<script language="javascript">
//表单数据有效性验证
function checkForm()
{
testForm.submit();
}
function resetForm()
{
document.testForm.resetTest.click();
}
</script>
</head>
<body>
<form name="testForm" method="post" action="createReport.jsp">
<input type="file" name="fileName">
<input type="reset" value="reset" name="resetTest" style="display:none">
<a href="javascript:resetForm()">Reset Form</a>
<input type="button" onclick="checkForm()" value="Check">
</form>
</body>
</html>