    pks_target.append(input);
            }
        }
    });

    document.getElementById("dynamic_group_assignment_cancel").addEventListener("click", (e) => {
        // Clear form data on cancel, but not on "close" "x" button
        $("#dynamic_group_assignment_modal").modal("hide");
        document.getElementById("dynamic_group_assignment_all").value = "";
        document.getElementById("dynamic_group_assignment_pks").replaceChildren();
        document.getElementById("id_create_and_assign_to_new_gro