How can I disable a button in a jQuery dialog from a function?

You would want to set the disabled property

 $('#continueButton').attr("disabled", true);

Update: Ahha, I see the complexity now. The jQuery Dialog had a single line that will be of use (under the “buttons” section.

 var buttons = $('.selector').dialog('option', 'buttons');

You’ll need to get the buttons collection from the dialog, loop through that to find which one you need, and then set the disabled attribute as I showed above.

Leave a Comment