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

267
Vistas
Why if I assign an id to my checkbox, it no longer passes the change in value it undergoes to the controller?

I have an MVC application, I am trying to add a new checkbox to a PartialView, initially I did some tests to make sure that this works correctly and passes the values to the controller, and it did. Then I added a script that blocks some textboxes if the checkbox in question is True, the problem is that they assign the id to the checkbox, the controller no longer receives the value "True" when I check. I thought it might be the script I wrote that was causing problems, so I mentioned it, but it still doesn't work, as soon as I remove the id from the checkbox it works again. How can I fix this?

 <div class="col-md-4" id="container">
    <label class="lblForm">  @Html.LabelFor(model => model.OnBds, "On BdS ", new { id = "BDS" })</label>
    <div class="d-flex">
        @Html.CheckBoxFor(model => model.OnBds , new { @onChange = "ValueCheck", id = "BDSCh" })
    </div>
</div>

I also tried to insert a HiddenFor and assign it the value True through a script, but that didn't work either

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

0

Is it a single checkbox? and you have attach a fixed ID to the checkbox, doesn't it help and how new IDs are attached to it? It will be helpful if you could share debug image of your page using chrome or firefox developer tools

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