Blue
White
Purple
Green
Red
Orange
Blue Light
White Light
Purple Light
Green Light
Red Light
Orange Light
how can you sort the list that is by alphabet?
Check this:https://stackoverflow.com/questions/12073270/sorting-options-elements-alphabetically-using-jqueryThe following code seems to be working. Put it to Javascript OnLoad event of the List page in question:
var sel = $('#simpleSrchTypeCombo1');var selected = sel.val(); // cache selected value, before reorderingvar opts_list = sel.find('option');opts_list.sort(function(a, <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=87558&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' /> { return $(a).text() > $(<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=87558&image=2&table=forumreplies' class='bbc_emoticon' alt='B)' />.text() ? 1 : -1; });sel.html('').append(opts_list);sel.val(selected);
thanks, it works with this codevar sel = $('select[id^=simpleSrchFieldsCombo1]');var selected = sel.val(); // cache selected value, before reorderingvar opts_list = sel.find('option');opts_list.sort(function(a, <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=87567&image=1&table=forumreplies' class='bbc_emoticon' alt='B)' /> { return $(a).text() > $(<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=87567&image=2&table=forumreplies' class='bbc_emoticon' alt='B)' />.text() ? 1 : -1; });sel.html('').append(opts_list);sel.val(selected);