Reputation: 1543
When I click on a jquery ui button, it still triggers the click event callback. How do I block that event? Do I have to manually keep track of the state or does jquery ui take care of that for me?
Upvotes: 30
Views: 33960
Reputation: 371
If you define like this:
$("#mybtn").button();
you must enable/disable like this:
$("#mybtn").button("enable");
// OR
$("#mybtn").button("disable");
Upvotes: 3
Reputation: 358
It works for me:
$("#button_id").attr("disabled", true).addClass("ui-state-disabled");
Upvotes: 24
Reputation: 1931
according the documentation:
// setter
$( "#button_id" ).button( "option", "disabled", true );
Upvotes: 18
Reputation: 66480
Try this.
$('#button_id').button("disable");
$('#button_id').button("enable");
Upvotes: 41