[jQuery] Disabling and enabling form buttons

[jQuery] Disabling and enabling form buttons


If the second argument to .set() is null (==undefined, like a missing
argument) then the method assumes the first argument is an object with a
list of attributes and values. Try this instead:
$('input[@type=button]').set({'disabled': null});
-----Original Message-----
From: discuss-bounces@jquery.com [mailto:discuss-bounces@jquery.com] On
Behalf Of Choan C. Gálvez
Sent: Tuesday, May 09, 2006 9:34 AM
To: jQuery Discussion.
Subject: [jQuery] Disabling and enabling form buttons
Hi all.
This question actually came from a friend at an Spanish mailing list
(aproximate translation):
"I'm disabling some buttons on loading the page, using this code:
$('input[@type=button]').set('disabled', 'disabled');
But it seems that jquery can't enable them again. Ideas?"
Then I answered saying:
"This code should do the work:
$('input[@type=button]').each(function() {
this.disabled = null;
});
but I haven't tested it yet."
Well, now _my_ proposed code is tested and works correctly. But: isn't
really any way of removing attributes using $('*').set?
TIA.
--
Choan
<http://choangalvez.nom.es/>
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/
_______________________________________________
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/