drgullin / icheck

Highly customizable checkboxes and radio buttons (jQuery & Zepto)
http://fronteed.com/iCheck
7.39k stars 1.63k forks source link

iCheck Reflect Loaded Checkbox #407

Open mprythero opened 5 years ago

mprythero commented 5 years ago

On a blade in my Laravel project I have the following:

<td> 
@if($sD->transfer == 1) 
<input type="checkbox" class="icheckboxTransfer" name="transfer" data-id="{{$sD->id}}" value="1" checked="checked">  
@else 
<input type="checkbox" class="icheckboxTransfer" name="transfer" data-id="{{$sD->id}}" value="1"> 
@endif
</td>

With the first half of the conditional statement, the checkbox is checked, and from the rendered html code, it is correctly set with the checked value on page load.

But, the iCheck checkbox remains empty and unchecked. I can still use it, so I know it is working correctly, but I guess I'm unsure how to get it to load as checked.

Thanks