I am trying to implement material css to my mvc app, but checkboxfor is giving me hard time. The thing is check box in materialcss has a specific usage setup like this
@for (int j = 0; j < Model.Questions[i].Answers.Count; j++)
{
<label>
<input type="checkbox" />
<span>Red</span>
</label>
}
if you don't do it like this it won't work, so, naturally I've tried
@for (int j = 0; j < Model.Questions[i].Answers.Count; j++)
{
<label>
@Html.EditorFor(model => Model.Questions[i].Answers[j].IsTrueUserChoice)
@* or this *@
@Html.CheckBoxFor(model => Model.Questions[i].Answers[j].IsTrueUserChoice)
<span></span>
</label>
}
htm.editorfor and checkboxfor render 2 checkbox tags one is visible and one is hidden (that how checkbox work in mvc), but with materializecss I can't do that because <span></span> has to go bellow <input type="checkbox"/> so this is not going to work because the hidden checkbox field is below checkbox.
Do you have any suggestions on how to fix this?
ivariable in it in the code snippet.