Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

151
Vistas
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 la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda