diff options
author | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-30 19:30:44 +0000 |
---|---|---|
committer | Angie Byron <webchick@24967.no-reply.drupal.org> | 2010-04-30 19:30:44 +0000 |
commit | c1bb8d1ecd2a19d3574076536753039437ecf672 (patch) | |
tree | c5afcac81ca025e7d9307248940e760d42663195 /misc | |
parent | 682ad44a506ea21640b9c052e801a7f75ed4bd9a (diff) | |
download | brdo-c1bb8d1ecd2a19d3574076536753039437ecf672.tar.gz brdo-c1bb8d1ecd2a19d3574076536753039437ecf672.tar.bz2 |
#767268 by sun, rfay: Fixed #states doesn't work correctly with radio buttons.
Diffstat (limited to 'misc')
-rw-r--r-- | misc/states.js | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/misc/states.js b/misc/states.js index 04a1a6c0b..41b30488b 100644 --- a/misc/states.js +++ b/misc/states.js @@ -247,11 +247,22 @@ states.Trigger.states = { } }, + // For radio buttons, only return the value if the radio button is selected. value: { 'keyup': function () { + // Radio buttons share the same :input[name="key"] selector. + if (this.length > 1) { + // Initial checked value of radios is undefined, so we return false. + return this.filter(':checked').val() || false; + } return this.val(); }, 'change': function () { + // Radio buttons share the same :input[name="key"] selector. + if (this.length > 1) { + // Initial checked value of radios is undefined, so we return false. + return this.filter(':checked').val() || false; + } return this.val(); } }, |