I am trying to use Select2 ( https://select2.imtqy.com ) to allow the user to enter multiple tags in the field before submitting the form. In my Laravel PHP application I will take those tags, determine if they exist and add them to the database.
My problem is that I cannot get Select2 to recognize that the user is entering multiple tags. When I interrogate form data, I see only the LAST tag that the user entered, and not ALL tags.
My Select2 element:
<select class="tags-field" name="tags" data-tags="true" data-placeholder="TAGS" multiple="multiple"> </select>
and my jquery:
$(function() { $(".tags-field").select2({ maximumSelectionLength: 3, tokenSeparators: [','], }); }
There are no Javascript errors, and it works great, but I cannot detect ALL tags.
source share