How to submit multiple values from a select2 dropdown in html form

Viewed 20

Context: This contains 1 select2 dropdown with the ability to select multiple options

    <div class="form-group" id="mediaBox" >
    
                                <label for="i">
                                    Media Type
                                </label>
                               
                                <select class="form-control" name="mediatype" style="width: 100%;" multiple="multiple" id="i">
                                    
    
    
                                    <option>Original</option>
                                    <option>Videogame</option>
                                    <option>Comic and/or Manga</option>
                                    <option>TV</option>
                                    <option>Movie</option>
                                    <option>Novel and Book</option>
    
                                </select>
    
                            </div>

Pictures of problem(Visual representation of the problem):

Picture 1(Second select2 dropdown): enter image description here

Output: enter image description here Problem: When I submit a form with multiple values from a select2 dropdown(I have 1 select2 dropdowns in this form that allows me to select multiple values) they each submit only one value I selected and not all of them for the mediatype variable. Can you help me solve this problem? Modify any html code if necessary.

0 Answers
Related