Javascript 多次按时,使表单仅提交一次
我的表格是这样的:Javascript 多次按时,使表单仅提交一次,javascript,html,Javascript,Html,我的表格是这样的: <form method="post" action="kudos.php"> <input type="hidden" name="hidden_id" value="<?php echo $id ?>"> <input type="hidden" name="hidden_ident&q
<form method="post" action="kudos.php">
<input type="hidden" name="hidden_id" value="<?php echo $id ?>">
<input type="hidden" name="hidden_ident" value="<?php echo $myIdent ?>">
<button type="submit" id="kudosBtn" class="kudosBtn"></button>
</form>
关于如何修复此问题的任何提示?这是假设您正在使用jQuery,基于您提供的代码:
$("#kudosBtn").click(function() {
$(this).prop("disabled", "true");
})
$(此)
现在将引用您想要的$(“#kudosBtn”)
。在字段上添加必填项,并在提交时清除输入。现在还不清楚你是如何提交的,action说action=“kudos.php”意味着在定期提交后,它应该转到那个页面。。。
$("#kudosBtn").click(function() {
$(this).prop("disabled", "true");
})