Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/03/2014, 13:26
miguelangel23
 
Fecha de Ingreso: diciembre-2009
Mensajes: 82
Antigüedad: 14 años, 4 meses
Puntos: 0
Ordenar alfabéticamente opciones select

Hola gente de foros del web, espero que se encuentren bien, quisiera hacerles la siguiente consulta. Tengo un dropdown con 5 opciones (Estas se muestran en la siguiente imagen que adjunto)
Código:
http://s2.subirimagenes.com/imagen/previo/thump_8854143dropdown.png
Lo que quiero hacer es que cuando seleccione por ejemplo la opción "Inactive" (Adjunto la sgte imagen donde aparecen las opciones cuando escogo Inactive)
Código:
http://s2.subirimagenes.com/imagen/previo/thump_8854147inactive.png
, la lista de opciones aparezca ordenada alfabeticamente. Lo mismo para cuando seleccione "Portfolio"
Código:
http://s2.subirimagenes.com/imagen/previo/thump_8854148portfolio.png
y así con las demás opciones del select.

Adjunto a continuación el código del Select:

Código HTML:
<select name="Team" id="Team" style="width:268px;" onchange="listcheck()" >
                <option value="" selected >Select one...</option>
                <%

                       If ListTeamExpress = "True" Then
                         If Request.QueryString("Sortby") = "TeamExpress" Then
                            %>
                               <option value="customer">Customer</option>
                            <%
                         Else
                            %>
                               <option value="freetrial">Free Trial</option>
                            <%
                         End If
                      End If

                      If ListInactive = "True" Then
                         If Request.QueryString("Sortby") = "Inactive" Then
                            %>
                            <option value="customer">Customer</option>
                            <%
                         Else
                            %>
                            <option value="inactive">Inactive</option>

                            <%
                         End If
                      End If

                      If ListPortfolio = "True" Then
                         If Request.QueryString("Sortby") = "Portfolio" Then
                            %>
                            <option value="customer">Customer</option>
                            <%
                         Else
                            %>
                            <option value="portfolio">Portfolio</option>

                            <%
                         End If
                      End If

                      If ListSponsors = "True" Then
                         If Request.QueryString("Sortby") = "Sponsor" Then
                            %>
                            <option value="customer">Customer</option>
                            <%
                         Else
                            %>
                            <option value="sponsor">Sponsor</option>
                            <%
                         End If
                      End If

                      If ListTeamPlayer = "True" Then
                         If Request.QueryString("Sortby") = "TeamPlayer" Then
                            %>
                            <option value="customer">Customer</option>
                            <%
                         Else
                            %>
                            <option value="teamplayer">Team Player</option>
                            <%
                         End If
                      End If

               %>
 </select> 
Creo que este ordenamiento se puede hacer mediante javascript. Espero me puedan ayudar.