sort javascript populated select list by alphabetical order
<p>I'm trying to sort my javascript popuplated select list and ive searched through all the other posts on this site but i cant get it to work...</p>

<p>here is my javascript that auto populates the select list from an data in an SQL db:</p>

<pre><code>for (clientKey in clientProjectsHash) {
            //alert("client:" + clientKey + ", name: " + clientProjectsHash[clientKey].name);
            clientSelect.options[clientSelect.options.length] = new Option(clientProjectsHash[clientKey].name, clientKey);

            if(selectedClientId == undefined || selectedClientId == 0) {
                if(clientKey &gt; 0) {
                    selectedClientId=clientKey;
                }
            }
</code></pre>

<p>ive tried to add:
<code>clientProjectsHash.sort();</code> to the top but it doesn't work... anyone help is appreciated!</p>

<p>Thanks!!</p>
