如何禁用所有按钮的页面上,而上传? [英] How to disable all buttons on the page while uploading?

查看:132
本文介绍了如何禁用所有按钮的页面上,而上传?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用在客户端的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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆