Skip to main content

Bug Tracker

Side navigation

Ticket #3240: 3240.diff
File 3240.diff, 1.4 KB (added by nathanhammond, August 15, 2008 02:50PM UTC)

Patch. Includes patch to test as well.

Index: jquery/test/index.html
===================================================================
--- jquery/test/index.html	(revision 5830)
+++ jquery/test/index.html	(working copy)
@@ -89,6 +89,15 @@
 				<option id="option3d" value="3">3</option>
 				<option id="option3e">no value</option>
 			</select>
+			<select name="select4" id="select4" multiple="multiple">
+				<optgroup disabled="disabled">
+					<option id="option4a" class="emptyopt" value="">Nothing</option>
+					<option id="option4b" selected="selected" value="1">1</option>
+					<option id="option4c" selected="selected" value="2">2</option>
+				</optgroup>
+				<option selected="selected" disabled="disabled" id="option4d" value="3">3</option>
+				<option id="option4e">no value</option>
+			</select>
 			
 			<object id="object1" codebase="stupid">
 				<param name="p1" value="x1" />
Index: jquery/src/core.js
===================================================================
--- jquery/src/core.js	(revision 5830)
+++ jquery/src/core.js	(working copy)
@@ -376,7 +376,7 @@
 					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
 						var option = options[ i ];
 
-						if ( option.selected ) {
+						if ( option.selected && !option.disabled && !option.parentNode.disabled ) {
 							// Get the specifc value for the option
 							value = jQuery(option).val();

Download in other formats:

Original Format