This module works great on node edit screens, so I was wondering it would be possible to extend the module for more generic form integration. In my particular case, I would like to see it to be used as an API in the block_term module https://drupal.org/project/block_term, but I imagine there are a lot of other places that could use the functionality.

As a model for the implementation, perhaps you could look at https://drupal.org/project/multiselect, which is a similar solution that also happens to include FAPI integration. I prefer this modules presentation, but it would be sweet to do something like this (from the multiselect page):

FAPI integration - allows module developers to create new form components using '#type' => 'multiselect'

Comments

joshua.boltz’s picture

I know this issue is based on D7, but I was looking for this same thing for D8+. And without this module providing its own form API element, it's not really easy to use this module outside the context of the field system, such as in a custom form API form.

But, I did come across this module, that seems to basically do just that.
https://www.drupal.org/project/multivalue_form_element

Hope this helps someone also looking for this type of solution.