我有一個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
謝謝,保存了一天 –