sparkbox / Custom-Selectbox

Select box UI replacement
70 stars 25 forks source link

Uncaught TypeError: Cannot set property 'selected' of undefined #15

Open binoyav opened 12 years ago

binoyav commented 12 years ago

Showing error for the following drop down <select name="data[Album][album_date][day]" class="sparkbox-custom"> <option value="">DD</option> <option value="01">1</option> <option value="02">2</option> </select>

If the key is 1, 2 it is working... Otherwise it is showing error "Uncaught TypeError: Cannot set property 'selected' of undefined" on jquery.sparkbox-select.js at line 35

binoyav commented 12 years ago

If I change the line 31 to $option = $('.sb-custom[data-id=' + id + ']').find('option').filter('[value="' + $target.parent().attr('data-value') + '"]'); it is working fine... $target.parent().data('value') is only considering 01 as 1.