How to get materializecss checkbox to work with @Html.CheckBoxFor?

后端 未结 3 1657
醉酒成梦
醉酒成梦 2020-12-11 08:01

So I\'m having an issue trying to implement materializecss\' checkbox with @Html.CheckBoxFor. If I input exactly:



        
3条回答
  •  死守一世寂寞
    2020-12-11 08:42

    I Was having same problem and the order of ChecBoxFor and LabelFor were like peter.edwards suggest. For me the problem was caused by a hidden element generated by @Html.CheckBoxFor:

    
    
    
    

    What I did to solve the problem was, move the hidden element to the bottom of the parent element:

     $("input[type='hidden']").each(function (index, element) { 
            $(this).appendTo($(element).parent());
        });
    

提交回复
热议问题