【发布时间】:2012-11-27 20:59:08
【问题描述】:
我试图在单击按钮后禁用它,以使其无法被双击。
这就是我所拥有的:
<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') + '" />');
}
});
}
按钮禁用但不提交表单。
如何在点击后禁用它然后提交表单?
【问题讨论】:
标签: c# javascript asp.net-mvc