vestman / Select-or-Die

Yet another jQuery plugin to style select elements. Demo at http://vst.mn/selectordie/
MIT License
524 stars 133 forks source link

Replace placeholder text with selected list item text on submit? #3

Closed welly closed 9 years ago

welly commented 10 years ago

Fantastic widget! Thank you so much for your work on this.

I have a request, unless the functionality is there and I'm not using it correctly! When I use placeholder text, I've noticed when you submit a form, the placeholder text is showing in the select boxes rather than the selectors showing the previously selected list item. Is there a way of doing this?

Thanks!

vestman commented 9 years ago

Could you give me an example?

Edit: Thanks, I'm glad you like it!

PawelGIX commented 9 years ago

SOD don't display selected option on page load if there is placeholder configured. Maybe you should add empty option on beginning of select input in this scenario (but not displayed in sod) - this reflects first empty state.

vestman commented 9 years ago

Well, @welly, it only took me 3 months. But after reading the comment from @PawelGIX I added a second placeholder option that will use the first <option> in the select as the placeholder. Don't know if this is what you're looking for, @welly.

bryannielsen commented 9 years ago

I think I'm seeing this issue too, if you have a placeholder set (I'm using data-placeholder) and you load a