我正在尝试以表单形式提交,但它无法正常工作,我想在点击后禁用提交按钮。
<form action="Buy" method="POST" >
<input type="hidden" name="TID" value="${TID}"/>
<td align="center" valign="middle">
<button onclick="this.disabled = true; document.getElementById('up7913').disabled = false;" type="submit" name="down7913" id="down7913">Subscribe Now</button></td>
</form>
答案 0 :(得分:0)
绑定到submit
事件并禁用该按钮。
document.getElementById('form').addEventListener('submit', function(event) {
event.preventDefault();
this.down7913.disabled = true;
// handle POST request
});