+ Start a Discussion

How to Sort DropDown list at VF page level..using JavaScript?

I have the following VF page...


<apex:pageBlock title="SearchArticle" id="SearchArticle">

  <apex:outputLabel value="MagaZine" for="MagaZine"/>
                    <apex:selectList value="{!selectedMagaZine}" multiselect="false" size="1" id="selecMagaZine">
                        <apex:selectOptions value="{!soMagaZine}"/>



Where from Controller I am getting the Dropdown List...Requirement doesnot allow me to change controller....

I have to sort the dropdown values in VF page level using Jscipt on Window.Onload...Please help me to write the JS.....


Using  JavaScript Remoting  you can perform this -





Thank you,



Please mark this as solution for others to get it easily.


I am pretty mush new to SF...not able to get anything from the above link as it requires controller modification....Any example would be a great help..