Monday, May 22, 2017

Select2 Tagging support on Laravel 5.4 not working properly

I created a blog, and put the Tagging system on it, but in the post create page, my tags looks like this: tag bug

This is my HTML code:

    <select name="tags[]" id="select2-multi" class="form-control select2-multi" multiple="multiple">
                @foreach($tags as $tag)
                    <option value=""></option>
                @endforeach
            </select>

And this is my script:

    $('#select2-multi').select2({
        tags: true,
        tokenSeparators: [",", " "],
        multiple: true
    })

What can i do to solve this? Helps



via DEMONIOalpha

Advertisement