vendredi 5 mai 2017

Unable to get checkbox data when using iCheck Plugin

I feel like i'm missing something but i can't seem to figure it out, so i was hoping someone on here could point me in the right direction.

In short i'm using the iCheck plugin (http://ift.tt/1VqAPUw). When i submit my form with checkboxes the checkboxes that show checked do not show in the request data ( dd($request->all()) ).

But if i disable iCheck, they show up as expected.

I have tried to manually set the input attr via jQuery/JS to checked but that still doesn't seem to work...

  <div class="form-group">
    <label class="col-md-3 control-label"></label>
    <div class="col-md-8 iCheck">
        <input name="roles[]" type="checkbox" value="1">
        Administrator
    </div>
  </div>
  <div class="form-group">
    <label class="col-md-3 control-label"></label>
    <div class="col-md-8 iCheck">
        <input name="roles[]" type="checkbox" value="2">
        User
    </div>
  </div>

$('.iCheck input').iCheck({
  checkboxClass: 'icheckbox_flat-orange',
  increaseArea: '10%',
 });




Aucun commentaire:

Enregistrer un commentaire