我有一个id theForm的表单,里面有以下div和提交按钮:
<div id="placeOrder"
style="text-align: right; width: 100%; background-color: white;">
<button type="submit"
class='input_submit'
style="margin-right: 15px;"
onClick="placeOrder()">Place Order
</button>
</div>
单击时,将调用placeOrder()函数。该函数将上述div的innerHTML更改为“processing…”(所以提交按钮现在没有了)。
上面的代码工作,但现在的问题是,我不能让表单提交!我试着把这个放在placeOrder()函数中:
document.theForm.submit();
但这行不通。
我怎样才能提交表单?