Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I disable a jqueryui button

People also ask

How do I make a button disabled?

The disabled attribute is a boolean attribute. When present, it specifies that the button should be disabled. A disabled button is unusable and un-clickable. The disabled attribute can be set to keep a user from clicking on the button until some other condition has been met (like selecting a checkbox, etc.).

How do I disable kendo button?

You can initially configure the Button as disabled either through its enable property or by initializing it from an element which has a disabled="disabled" HTML attribute. The Button can also be disabled or enabled at any time with JavaScript by using its enable() method with a Boolean argument.

How do you make a button disabled in CSS?

To make the disabled button, we will use the Pure CSS class “pure-button-disabled” with the class “pure-button”. We can also create a disabled button using disabled attribute. Disabled Button used Class: pure-button-disabled: It is used to disable the Pure CSS button.


Try this.

$('#button_id').button("disable");
$('#button_id').button("enable");

It works for me:

$("#button_id").attr("disabled", true).addClass("ui-state-disabled");

according the documentation:

// setter
$( "#button_id" ).button( "option", "disabled", true );

If you define like this:

$("#mybtn").button();

you must enable/disable like this:

$("#mybtn").button("enable");
// OR
$("#mybtn").button("disable");