使用按钮禁用数据禁用功能在Chrome上不起作用 [英] data-disable-with button option doesn't work on Chrome
本文介绍了使用按钮禁用数据禁用功能在Chrome上不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
以下HTML应该在提交时禁用并相应地重命名按钮:
The following HTML should disable and rename the button accordingly while submitting :
<button data-disable-with="Please wait..." name="button" type="submit">Checkout</button>
但是在myChrome浏览器中,它什么也没做. 我能做什么?
But in myChrome browser it doesn't do anything. Anything I can do ?
我的Chrome版本是30
My Chrome version is 30
推荐答案
data-disable-with
仅可用于rails表单元素.但是,如果要将其应用于HTML表单元素,则可以执行如下操作-
data-disable-with
can only be used in rails form element. But if you want to apply it on HTML form elements you can do something like as follows-
您可以尝试data-loading-text="Loading..."
以及js代码段.
You can try data-loading-text="Loading..."
along with a js code snippet.
$("#btn1").on("click", function(){
$(this).button("loading");
})
这篇关于使用按钮禁用数据禁用功能在Chrome上不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文