user342391
user342391

Reputation: 7827

How to show disabled state for a jqueryui button?

I am using Jquery UI buttons (http://jqueryui.com/demos/button/). I would like to know how I can show a disabled state. Show the button as greyed out or something, you know how when you post a form on some sites the submit button shows as disabled.

Also is there anyway to display an active state???

This is my code:

 $(".commentsbutton").button({icons: { primary: 'ui-icon-comment'}}); 

<a href="javascript:void[0]">Comments</a>

Upvotes: 1

Views: 2899

Answers (1)

Nick Craver
Nick Craver

Reputation: 630349

You can disable the button via the disable method, like this:

$(".commentsbutton").button("disable");​​​​​​​​​​​​​

You can give it a try here, to re-enable later, just use the enable method, like this:

$(".commentsbutton").button("enable");​​​​​​​​​​​​​

Upvotes: 3

Related Questions