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

269
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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