Html.CheckBox displays two checkboxes
When I try to serialize <%: Html.CheckBox("Something", true) %> in jquery (using form.serialize ()), I get two checkboxes, one says true and the other says false. I know that MVC displays true, false for checkboxes that are true, so if I don't go through javascript, I will just check for true, but how do I know if my checkbox is checked after the form. serialization?
If you look at the HTML output, you will see that Html.Checkbox () actually displays additional hidden input there with the same name. That is why you see two meanings. I believe that MS decided to do this so that the correct bool gets POSTED (and not the string value 'on' for flags).
To get around this, I no longer use the Html.Checkbox () helper, I always just write the full HTML.