我有一个ID为ID的表单,theForm
该表单具有以下div,其中包含一个Submit按钮:
<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();
但这是行不通的。
我该如何提交表格?
<form>
在页面的某个位置有一个标签。