再会 !
单击后如何阻止表单按钮?
我用谷歌搜索,但我搜索的只是带有大量代码的拐杖。
是否有简洁易懂的代码选项?
我对js不熟悉,我只使用了现成的代码。
UPD
我找到了这段代码,但它隐藏了按钮。
$('#sendApplySettingsButton').click(function(){
$(this).hide();
});
我试图以这种方式停用它 $(this).attr("disabled", "disabled");,停用工作,但处理程序没有启动。
为什么处理程序没有运行?
在表单中,action没有为属性指定处理程序,因为处理程序代码与表单位于同一文件中。
UPD#2
我得到了这段代码:
function blockMultiButton()
{
$('#sendApplySettingsButton').click(function(){
document.querySelector('#sendApplySettingsButton').disabled = true;
});
return false;
}
在我指出的表格中onsubmit="blockMultiButton()"
感谢所有试图提供帮助的人!
有一个想法可以进行“状态”之类的检查。