I am using a repeating form field inside the SAME FORM. I have my input form field named as an array e.g. first_name[]
, gender[]
.
In this case when a radio button is clicked then it affects radio buttons of other repeated form groups.
$('#repeatButton ').on('click', function() {
var repeater = $('#repeater .items').clone();
$('#repeater').append(repeater);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script><form action=""><div id="repeater"><div class="form-group items"><input type="radio" value="male" name="gender[]"><label>Male</label><input type="radio" value="female" name="gender[]"><label>Female</label></div></div><input value="add" id="repeatButton"></form>