This works for a combobox / list box <br /><br />SAMPLE:
http://www.sendspace.com/file/f1pf2w<br />(click the link & scroll down a little up to the dload link)<br /><br />Field containing a string consisting of items separated by commas,<br />Click on the button, which splits the string according to the specified delimiter, it sorts the items alphabetically, clears the current items in the listbox so that it does not append the new ones to the existing items & finally sets the items in the listbox<br /><br />var Items = field.rawValue.split(','); // splits using comma <br />Items.sort(); // sorts the items alphabetically<br />listbox.clearItems(); // clears the current items<br /><br />for(var i=0;i<Items.length;i++)<br /> <br />{<br /> listbox.addItem(Items[i]); // adds items <br />}