mardi 30 mai 2017

dynamic checkbox with icheck style

I'm using icheck for some cool checkboxes but there's a problem.

When I load the page, the initial checkboxes have the correct style, but when I append checkboxes with jquery, the new checkboxes aren't displaying themselves.

here's some code :



this is the checkboxes that are loaded with HTML / TWIG when the page is opened, they are displayed

then :

text_checkbx = '<label class="ckbox">Valider<input type="checkbox" name="validate"></label>'

this is the exact same code than the HTML for the append in JQUERY

text = text + text_checkbx + '</div>';
$('.crawl-body').append(text);
$('.crawl-body').iCheck();

the weird thing I noticed is that with the developper tool, it's as if a icheck checkbox was there but nothing was shown.

thanks if you could share ideas with me

I'm not english so don't shout if there's some mistakes, just edit please




Aucun commentaire:

Enregistrer un commentaire