如何禁用所有按钮的页面上,而上传? [英] How to disable all buttons on the page while uploading?
问题描述
我使用在客户端的JSON + jQuery的。我想禁用页面上找到,而上传文件中的所有按钮。目前我只禁止使用其标识的上传按钮,如下图所示。
$(#upload_attachment_button)addClass(UI状态禁用')。
块引用>我不知道是否有禁用页上的按钮,其余的方法。我已经做到了我想要的所有系统使用的函数,而我不想我要调用此函数每次发送的按钮ID ..
感谢。
解决方案这是相当简单的。选择类型按钮形式的所有投入要素和禁用它们:
$(输入[类型=按钮])ATTR(禁用,禁用)。
I'm using json +jquery on client side. I want to disable all buttons found on the page while uploading file. Currently I'm disabling the upload button only using its id as shown below..
$("#upload_attachment_button").addClass('ui-state-disabled');
I wonder if there is a way to disable the rest of the buttons found on the page. I have done a function that I want to use by all the system, and I don't want to send the buttons id every time I want to call this function..
Thanks.
解决方案It's rather simple. Select all the input elements of the form with type button and disable them:
$("input[type=button]").attr("disabled", "disabled");
这篇关于如何禁用所有按钮的页面上,而上传?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!