If you've ever looked at what ASP.NET MVC actually renders when you use @Html.CheckBoxFor
, then you've seen that each checkbox you request to be rendered actually results in the emission of not one but two input
tags. One is the "true" value checkbox, and the other is for "false." The latter input is of type "hidden".
Generally this doesn't cause problems if you're using ASP.NET MVC correctly. You wouldn't notice the input doubling unless you tried to, for example, do something directly with Request.Form
(e.g. Why does ASP.NET MVC Html.CheckBox output two INPUTs with the same name?)
My question, though, is how screen readers deal with this. For example, can they be relied upon to correctly report only the visible checkbox to the site user?
type="hidden"
then there is no issue. If, as you say, they are bothtype="checkbox"
then I would want to see theirid
s and how they are labeled next. - aardrian