jeudi 14 septembre 2017

Styling @Html.CheckBoxFor as a slider

I'm having trouble styling a checkbox generated by @Html.CheckBoxFor as a slider. I've identified the "culprit" to be the hidden input field. I've made a fiddle to illustrate the problem. It contains 3 checkboxes - one generated by @Html.CheckBoxFor, the second one using the code generated by @Html.CheckBoxFor with the hidden input commented out and the third classic checkbox. You will see the slider is not working for the first one. I do need to use @Html.CheckBoxFor because I want the checkbox to be bound to a property on my model, but can't figure out how to make the slider styling work...

Aucun commentaire:

Enregistrer un commentaire