Problem:
The issue here is that the user wanted to integrate the select2 dropdowns for their Toolset forms Generic fields.
Solution:
This can be done by importing the select2 javascript and css library.
Add the following to your custom code snippets at Toolset->Settings-> Custom Code and activate it.
[php]
wp_enqueue_script('select2_js', '//cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js', array(), null, true);
wp_enqueue_style( 'select2_css', '//cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css' );
[/php]
From there you will need to add the following JS to your Form's JS section to enable the select2 for your field.
[php]
jQuery(document).ready(function() {
jQuery('.class-goes-here').select2();
});
[/php]
Now you will need to replace 'class-goes-here' with the ID/Class of the custom field that is generated on the frontend.
For further information on the usage of Select2 I recommend looking at the documentation below.
https://select2.org/getting-started/basic-usage