mercredi 17 octobre 2018

checkbox does not change visual state

This might be very simple, but I am breaking my head for an hour already. I have a simple radio with two buttons:

<input class="form-control icheck" id="cash_prize" name="cash_prize" type="radio" value="1" style="position: absolute; opacity: 0;">
<input class="form-control icheck" id="noncash_prize" name="cash_prize" type="radio" value="0" style="position: absolute; opacity: 0;">

And a checkbox:

<input class="form-control icheck" id="issuable_via_logistics" name="issuable_via_logistics" type="checkbox" value="1" style="position: absolute; opacity: 0;">

On radio with id "cash_prize" On click I fire up a JS function:

$('#cash_prize').on('ifChecked', function(){
    var chkbox = $('#issuable_via_logistics');
    chkbox.prop('checked', false);

Checkbox gets unchecked if I am checking it's state, but visually it remains checked. Please, how to change that?




Aucun commentaire:

Enregistrer un commentaire