Categories
October Surprise 2016

Placeholders | Select2 – The jQuery replacement for select boxes

When using Select2 in single-selection mode, the placeholder option will be passed through the templateSelection callback if specified. You can use some additional logic in this callback to check the id property and apply an alternative transformation to your placeholder option: