$('.form').on('submit', function (e) {
e.preventDefault();
const values = {};
$('.form__check').each(function () {
if ($(this).is(':checked')) {
const [name, ...keys] = $(this).attr('name').split('-');
if (name) {
(values[name] ??= []).push(keys.join('-'));
}
}
});
for (const key in values) {
$(`.inputs__value--${key}`).text(values[key].join(','));
}
});