Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable all buttons on the page while uploading?

Tags:

jquery

button

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.

like image 334
Luci Avatar asked Sep 29 '10 13:09

Luci


1 Answers

It's rather simple. Select all the input elements of the form with type button and disable them:

$("input[type=button]").attr("disabled", "disabled");
like image 161
Vasilis Lourdas Avatar answered Sep 21 '22 03:09

Vasilis Lourdas