I use the jquery plugin lc_switch http://ift.tt/1DSuO7u for toggle checkboxes.
HTML CODE :
<input type="checkbox" name="relation_cse" id="relation_cse" <?php echo $disabled; if ($relation_cse == "1") { echo " checked='checked' "; } ?>value="1" class="lcs_check " autocomplete="off" />
JS CODE on dom ready
$("#relation_cse").lc_switch('Oui', 'Non');
When i have an error i try to change the backgound color like this but this does not works
$(".lcs_cursor").css( "background", "red" );
$('.lcs_switch').css( "background", "red none repeat scroll 0 0" );
$('.lcs_on').css( "background", "red none repeat scroll 0 0" );
The plugin generate the class over in javascript copy of generated code :
<div class="lcs_wrap">
<input id="relation_cse" class="lcs_check " type="checkbox" autocomplete="off" value="1" checked="checked" name="relation_cse">
<div class="lcs_switch lcs_on lcs_checkbox_switch">
<div class="lcs_cursor"></div>
<div class="lcs_label lcs_label_on">Oui</div>
<div class="lcs_label lcs_label_off">Non</div>
</div>
</div>
Thanks if someone have an idea !!!
Aucun commentaire:
Enregistrer un commentaire