I need help with sorting the options of a dropdown menu. I have the following:
<select name="models" id="models">
<option value="14b">14b</option>
<option value="ab">ab</option>
<option value="14">14</option>
<option value="bc">bc</option>
<option value="15">15</option>
<option value="101">101</option>
<option value="13">13</option>
</select>
I would like to sort the options so they appear as following:
<select name="models" id="models">
<option value="ab">ab</option>
<option value="bc">bc</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="14b">14b</option>
<option value="15">15</option>
<option value="101">101</option>
</select>
The dropdown would have 2 types of entries, ones that start with a number and ones that start with a letter. I'd like to first simply just sort the ones that start with a letter alphabetically and place them at the beginning of the dropdown. Then, some of the ones that start with a number can occasionally have a letter or two at the end. The ones with letters would be considered one step greater than the ones without and would be positioned afterwards so an order would be 14 > 14b > 15 for example
I've searched and found several posts on how to sort lists / dropdowns but this is a bit more complicated and I can't seem to figure out on my own how to piece everything together. Can anyone please help? Thank you!
