Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

263
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!