Foros del Web » Programando para Internet » Javascript »

Ordenar alfabéticamente opciones select

Estas en el tema de Ordenar alfabéticamente opciones select en el foro de Javascript en Foros del Web. 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 ...
  #1 (permalink)  
Antiguo 20/03/2014, 13:26
 
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.

Etiquetas: opciones, select
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 16:15.