On Dec 21, 9:21 pm, Devon Govett <devongov...@gmail.com> wrote:
> I have found a bug in the jQuery.val() function.
> ...
> to the following in jQuery 1.4:
>     this.selected = jQuery.inArray( this.value || this.text, values ) >= 0;

Indeed, this is a (probably unnoticed) change in logic.

Consider this:

<select id="x">
  <option value="1">Dummy</option>
  <option value="">Empty</option>
</select>

$('#x').val('') ==> Will not select the second option!

> I can see why this optimization was done, but I think that this will
> cause problems for a lot of people!

Agreed, the change is broken! Wasn't there a test case for the above
scenario?

Matt Kruse

--

You received this message because you are subscribed to the Google Groups 
"jQuery Development" group.
To post to this group, send email to jquery-...@googlegroups.com.
To unsubscribe from this group, send email to 
jquery-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jquery-dev?hl=en.


Reply via email to