function hasOptions(obj)
{
if (obj!=null && obj.options!=null) { return true; }
return false;
}
function sortSelect(obj)
{
var o = new Array();
if (!hasOptions(obj)) { return; }
for (var i=0; i {
o[o.length] = new Option( obj.options[i].text, obj.options[i].value, obj.options[i].defaultSelected, obj.options[i].selected) ;
}
if (o.length==0) { return; }
o = o.sort(function(a,b){if ((a.text+"") < (b.text+"")) { return -1; } if ((a.text+"") > (b.text+"")) { return 1; } return 0;});
for (var i=0; i {
obj.options[i] = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);
}
}
function Onload()
{ //sortSelect(frmFeedback.cmbYears);
sortSelect(frmFeedback.cmbSource);
}
Call: