I'm about 4 years late to this party, but I was having the exact same issue earlier today and quickly found a very simple jQuery solution (credit to StackOverflow). It (appears) to loop through all of your drop-down's options and removes any duplicate text values.
JS:
$(document).ready(function() {
var usedNames = {};
HTML:
<select id="divSel" name="divSel" style="width:475px;" onchange="selectDate();" />
Hopefully this helps anyone else looking for the same functionality!
JS:
$(document).ready(function() {
var usedNames = {};
$("select[name='divSel'] > option").each(function () {
if(usedNames[this.text]) {
$(this).remove();
} else {
usedNames[this.text] = this.value;
}
});
});HTML:
<select id="divSel" name="divSel" style="width:475px;" onchange="selectDate();" />
Hopefully this helps anyone else looking for the same functionality!