I have jQuery code to update checkboxes on checkbox checkbox checkbox. However, this does not work.
the code
$('body').on('change', '.territory', function () {
var PK = $(this).find('input:checkbox:first').val();
var PKStr = '.parent' + PK;
console.log('change!');
});
$('body').on('change', '.iCheck-helper', function () {
console.log('change!');
});
<div class="row">
<div class="col-md-12 col-lg-12">
<label class="control-label">
Selected Territories
</label>
</div>
@for (int c = 0; c < 2; ++c)
{
int Count = 0;
<div class="col-md-6 col-lg-6">
@foreach (var ter in Infobase.MMS.Models.ComboBoxValues.GetTerritoryRights(0))
{
if (Count % 2 == c)
{
<label>
<input type="checkbox" class="territory" value="@ter.Key">
@ter.Value
</label>
}
Count++;
}
</div>
}
</div>
I tried to snap the click function and change the function to iCheckbox-Helper, as well as directly to the checkboxes. However, it does not seem to work. Everything works fine when I don't add a script to Icheck.js.
Does anyone know how to connect to a modified event from the Icheckhelper bootstrap class?
source
share