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

144
Visualizações
Select fields not displaying proper values in Bootstrap modal dialog

Using Bootstrap v5.x modal dialog to handle a mailing address update form.

When the page loads, the value= arguments for the <input> fields in my modal dialog are assigned using PHP. There are 2 <select> fields, one for the state, the other for the country. These both have their <option> lists provided by PHP as well. So all this information is pre-loaded into the modal's fields before the modal is ever shown.

The <input> fields display properly. However, the <select> fields do not display the <option> value having the selected argument set. When examining the HTML, the selected argument is indeed set on the correct value for each field, but BS appears to somehow override these being displayed when the modal is shown. It's as if the selected argument was not set at all.

So is this a bug with BS5? Or is it something I'm missing? Is there a workaround JS command I need to run after the modal is shown to refresh the <select> fields so they will display the selected values?

enter image description here

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