git.asbjorn.biz
/
jquery.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Don't have .val() return selected-but-disabled options, or selected options inside...
[jquery.git]
/
src
/
attributes.js
diff --git
a/src/attributes.js
b/src/attributes.js
index
73dee36
..
a76695b
100644
(file)
--- a/
src/attributes.js
+++ b/
src/attributes.js
@@
-163,8
+163,10
@@
jQuery.fn.extend({
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
var option = options[ i ];
for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
var option = options[ i ];
- if ( option.selected ) {
- // Get the specifc value for the option
+ // Don't return options that are disabled or in a disabled optgroup
+ if ( option.selected && !option.disabled &&
+ (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) {
+ // Get the specific value for the option
value = jQuery(option).val();
// We don't need an array for one selects
value = jQuery(option).val();
// We don't need an array for one selects