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

229
Vistas
Disabled dropdown option didn't work in semantic UI

This is my Cshtml

<div class="field">
    @Html.LabelFor(modelItem => modelItem.plateNumber)
    @Html.DropDownListFor(m => m.plateNumber, new SelectList(ViewBag.PlateNoList, "Value", "Text"),
    "", new { Class = "ui selection dropdown document-type" })
</div>
</div>
<div class="field">
    @Html.LabelFor(modelItem => modelItem.FuelType)
    @Html.DropDownListFor(m => m.FuelType, new SelectList(ViewBag.FuelType,"Value","Text"),
    "", new { Class = "ui selection dropdown fuel-type",@id="FuelType"/*, @disabled = "true"*/ })
</div>

This is my JavaScript

document.getElementById("FuelType").disabled = true;

$('#plateNumber').change(function() {
    $('.ui.dropdown').dropdown();
    document.getElementById("FuelType").disabled = false;
});

When the plateNumber dropdown is selected, the bottom FuelType dropdown should be available, but it cannot be used even though the plateNumber dropdown is selected, any idea?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try removing the disabled class from the dropdown as well. This is checked (and added) internally by SUI.

document.getElementById("FuelType").disabled = true;

$('#plateNumber').change(function() {
    document.getElementById("FuelType").disabled = false;
    $('.ui.dropdown').dropdown();
    $('.ui.dropdown').removeClass('disabled');

});
about 4 years ago · Juan Pablo Isaza Denunciar
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