Bug in Internet Explorer 8 prevents "label for" on secondary radio buttons
Found an interesting bug (and solution) that I'd love to share with you today. Having a razor view produce output similar to the below: <input type="radio" id="ParentCollection_0__ChildCollection_1__1" .../> < label for=" ParentCollection _0__ ChildCollection _1__1" > ... < /label > < input type="radio" id=" ParentCollection _0__ ChildCollection _1__2" .../ > < label for=" ParentCollection _0__ ChildCollection _1__2" > ... < /label > ... a colleague of mine testing the web app found, that the second label ( ParentCollection _0__ ChildCollection _1__2 ) did not cause the corresponding radio button to be checked. Trying the same view in Chrome and Firefox worked flawlessly, however. It turned out, that somehow, Internet Explorer found the ID-field too long, causing it to ignore it (go figure). Anyway, the problem was solved with shortening the ID as such: Dim radioId = ViewData