Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

139
Visualizações
ASP.Net Searchable/Filterable DropDownList Populated from the Database

I am attempting to search through a DropDownList. The list is populated from the database and not in any explicit front end list. For previous searches, I have used OnKeyUp in a textbox to search through rows. However, in this case there is no search textbox- the search must be done when the user clicks/hovers over the filter. Additionally, and less importantly, the search needs to start after the dash symbol (-) as items in the list start with acronyms as displayed here:

XYZ - Kansas

YBE - Delaware

CIT - New Jersey

The code:

<ASP:DropDownList ID="ddlProgram" AutoPostBack="true" runat="server" />

Any thoughts on this? I found some useful code that may be relevant here but it seems to require a textbox as input and a front end list but the logic seems sound:

function searchSel() 
    {
      var input = document.getElementById('realtxt').value.toLowerCase();

          len = input.length;
          output = document.getElementById('realitems').options;
      for(var i=0; i<output.length; i++)
          if (output[i].text.toLowerCase().indexOf(input) != -1 ){
          output[i].selected = true;
              break;
          }
      if (input == '')
        output[0].selected = true;
    }
about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda