Saturday, January 3, 2009

[jQuery] Re: - Enable then Disable buttons

Woops. Mistyped the second to last bracket. Should be a '(', rather than '{';

$('#theSelectorForTheButton').click( function() {
var button = this;
button.disabled = true;
setTimeout( function() { button.disabled = false; }, 3000 );
});

On Sun, Jan 4, 2009 at 5:15 PM, Karl Rudd <karl.rudd@gmail.com> wrote:
> Untested but this should do the trick.
>
> $('#theSelectorForTheButton').click( function() {
> var button = this;
> button.disabled = true;
> setTimeout( function() { button.disabled = false; }, 3000 };
> });
>
> Karl Rudd
>
> On Sun, Jan 4, 2009 at 2:22 PM, Commandos <chaabant@gmail.com> wrote:
>>
>> How can i disable a button for 3 seconds then after that enable it
>> when a use click a button (to avoid the user clicking without
>> stopping)
>>
>>
>> Button Enabled -> user click the button -> button is disabled for 3
>> seconds -> button is enabled .
>

No comments: