How to get materialize CSS checkbox to work with @Html.CheckBoxFor?


The only way to materialize CSS checkbox to work with Html.checkbox without disappearance of the checkbox to the left is by moving the hidden element to the bottom of the parent element.

$("input[type='hidden']").each(checkbox1 (0,IsActive ) {
   $(this).appendTo($(IsActive).parent());
});

In this hidden element, IsActive is placed in the bottom of parent element thus removing the disappearance of the checkbox to left and thus materializing CSS checkbox to work with HTML.checkbox.

Updated on: 04-Mar-2020

134 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements