我有一个struts 2表单标签,我正在尝试使用java脚本函数提交表单。但是当我尝试执行此操作时,出现以下错误。提交不是js中的函数
"document.testForm.submit is not a function" IE 8(Object doesn't support this property or method)
这里是我的Java脚本功能和HTML代码: -
<script type="text/javascript">
function testFunction()
{
document.testForm.action = "testAction";
document.testForm.submit();
}
</script>
<s:form method="POST" id="fileForm" name="testForm"
enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td>
<input type="button" name="submit" value="Upload File" onclick="testFunction();"/>
</td>
</tr>
</tbody>
</table>
</s:form>
我使用FF 7和IE 8
请帮助我。
哇!这很微妙。感谢那。 – bchurchill
谢谢,保存了一天 –