I have problem with checked radio box set up. I want make edit function, and i have problem with my js code, who set checked value in my modal form (html code).
My variable data[6] holding value of name. And for example if my data[6] is Test, then checking my radio box, where id is EditTest and then give that radio box label class checked.
Problem is then i want chose another one button, not the Test (different).
If i pick different radio box label, checked not change.
My js code. first off all then clicked button in datatable edit, im clear all active and checked values.
$('input:radio').prop('checked', false);
$('label:has(input:not(:checked))').removeClass('active');
then i by id give that radio box checked
$('#Edit' + data[6]).prop('checked', true);
$('label:has(input:checked)').addClass('active');
My html
<div class="form-group row">
<label for="EditEventType" class="col-sm-2 col-form-label">TYPE:</label>
<div class="btn-group btn-group-toggle" data-toggle="buttons">
<label class="btn btn-light btn-sm active">
<input type="radio" name="Editnone" id="Editnone"> None
</label>
<label class="btn btn-primary btn-sm">
<input type="radio" name="EditTEST" id="EditTEST"> TEST
</label>
<label class="btn btn-primary btn-sm">
<input type="radio" name="EditTESTTWO" id="EditTESTTWO"> TESTTWO
</label>
<label class="btn btn-danger btn-sm">
<input type="radio" name="EditTESTTHREE" id="EditTESTTHREE"> TESTTHREE
</label>
</div>
</div>