我试图在点击后禁用按钮,以便它不能被双击。使用javascript禁止点击后提交按钮不会触发
这是我有:
<input id="btn" type="button" disabled="disabled" value="Log On" onclick="logonDisableSubmitButtons()"/>
而且我的javascript:
function logonDisableSubmitButtons(clickedButton) {
$("input[type='button']").each(function() {
if (this.name != clickedButton)
$(this).attr("disabled", "disabled");
else {
//hiding the actually clicked button
$(this).hide();
//Creating dummy button to same like clicked button
$(this).after('<input type="button" disabled="disabled" value="' + $(this).val() + '" class="' + $(this).attr('class') + '" />');
}
});
}
按钮禁用,但它不提交表单。
点击并提交表单后,如何禁用它?
够简单!完美工作! – ErocM