fixed name of independent radio groups

This commit is contained in:
Mirjan Hoffmann 2022-03-10 11:58:18 +01:00
parent b0097a8d14
commit ded168d805

View file

@ -441,15 +441,17 @@
$.each(vocabInstitutions, function (i, item) {
institutionOptions += '<option value="' + item["ror"] + '"' + (item["ror"] === institution ? ' selected' : '') + '>' + item["label"] + '</option>';
});
let radioGroupName = creatorList.childElementCount > 1 ? $(creatorList.lastElementChild.previousElementSibling).find('.inputType').find('input').attr('name') : ''
radioGroupName += 'x'
item.innerHTML = `
<div class="form-row">
<div class="btn-group btn-group-toggle inputType" role="group" data-toggle="buttons">
<label class="btn btn-outline-primary ${type === "Person" ? "active" : ""}" onclick="changeCreatorType(this.parentNode.parentNode.parentNode, 'Person')">
<input type="radio" name="options" ${type === "Person" ? "checked" : ""} value="Person"><span data-i18n="LABEL_PERSON">Person</span>
<input type="radio" name="${radioGroupName}" ${type === "Person" ? "checked" : ""} value="Person"><span data-i18n="LABEL_PERSON">Person</span>
</label>
<label class="btn btn-outline-primary ${type === "Organization" ? "active" : ""}" onclick="changeCreatorType(this.parentNode.parentNode.parentNode, 'Organization')">
<input type="radio" name="options" ${type === "Organization" ? "checked" : ""} value="Organization"><span data-i18n="LABEL_ORGANIZATION">Organisation</span>
<input type="radio" name="${radioGroupName}" ${type === "Organization" ? "checked" : ""} value="Organization"><span data-i18n="LABEL_ORGANIZATION">Organisation</span>
</label>
</div>
</div>