rvera / image-picker

Image Picker is a simple jQuery plugin that transforms a select element into a more user friendly graphical interface.
http://rvera.github.com/image-picker
Other
906 stars 216 forks source link

Change is_selected() to use selectedIndex property for selection instead of $.val() #55

Open juhah opened 9 years ago

juhah commented 9 years ago

Disabled select might not show the selected value due to $.val() returning null if the select is disabled, see: http://bugs.jquery.com/ticket/13097.

rvera commented 9 years ago

Looks good to me. A few questions:

juhah commented 9 years ago

Yes, might be better as a fallback solution... selectedIndex will return the first selected option for multiple selects so in that case it's best to walk the options list and gather the selected ones to an array.