| @@ 2397-2415 (lines=19) @@ | ||
| 2394 | // Loop through all the selected options |
|
| 2395 | i = one ? index : 0; |
|
| 2396 | max = one ? index + 1 : options.length; |
|
| 2397 | for ( ; i < max; i++ ) { |
|
| 2398 | option = options[ i ]; |
|
| 2399 | ||
| 2400 | // Don't return options that are disabled or in a disabled optgroup |
|
| 2401 | if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && |
|
| 2402 | (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { |
|
| 2403 | ||
| 2404 | // Get the specific value for the option |
|
| 2405 | value = jQuery( option ).val(); |
|
| 2406 | ||
| 2407 | // We don't need an array for one selects |
|
| 2408 | if ( one ) { |
|
| 2409 | return value; |
|
| 2410 | } |
|
| 2411 | ||
| 2412 | // Multi-Selects return an array |
|
| 2413 | values.push( value ); |
|
| 2414 | } |
|
| 2415 | } |
|
| 2416 | ||
| 2417 | // Fixes Bug #2551 -- select.val() broken in IE after form.reset() |
|
| 2418 | if ( one && !values.length && options.length ) { |
|
| @@ 1871-1889 (lines=19) @@ | ||
| 1868 | } |
|
| 1869 | ||
| 1870 | // Loop through all the selected options |
|
| 1871 | for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) { |
|
| 1872 | var option = options[ i ]; |
|
| 1873 | ||
| 1874 | // Don't return options that are disabled or in a disabled optgroup |
|
| 1875 | if ( option.selected && (jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null) && |
|
| 1876 | (!option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" )) ) { |
|
| 1877 | ||
| 1878 | // Get the specific value for the option |
|
| 1879 | value = jQuery(option).val(); |
|
| 1880 | ||
| 1881 | // We don't need an array for one selects |
|
| 1882 | if ( one ) { |
|
| 1883 | return value; |
|
| 1884 | } |
|
| 1885 | ||
| 1886 | // Multi-Selects return an array |
|
| 1887 | values.push( value ); |
|
| 1888 | } |
|
| 1889 | } |
|
| 1890 | ||
| 1891 | return values; |
|
| 1892 | } |
|