Skip to content

Commit

Permalink
dc fix collision of multiple datatype properties (#8887)
Browse files Browse the repository at this point in the history
  • Loading branch information
iszmais authored Jan 22, 2025
1 parent 756c05d commit 6fbcee0
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion components/ILIAS/DataCollection/resources/datacollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,12 @@ $(document).ready(function () {
caretPos) + placeholder + expression.substring(caretPos));
});

});
document.querySelector('form div#datatype').closest('form').addEventListener('submit', (event) => {
const types = event.target.querySelector('div#datatype');
types.querySelectorAll('input[id^="datatype_"]:not(:checked)').forEach((radio) => {
if (types.contains(types.querySelector(`div#subform_${radio.id}`))) {
types.querySelector(`div#subform_${radio.id}`).remove();
}
});
});
});

0 comments on commit 6fbcee0

Please sign in to comment.