Doubt with a multiple select [closed]

-4

I'm consulting because I have a question, because they can help me with information (afterwards I fix it) ... I want to put in a form, a select, that as the user goes choosing items, they will be shown as "labels" in the header of the select ... more or less as it is in this same page when a question is placed and below in labels they are left with an "X" to eliminate them ... I have been searching but I really do not know how to tell san google what to look for, apart I do not know if it will be very complex to place in the form ...

    
asked by MNibor 08.06.2017 в 15:26
source

2 answers

1

Hello, you can use BootstrapSelect from the following link link

and use the sample code

 <select class="selectpicker" multiple>
  <option value="1">Mustard</option>
  <option value="2">Ketchup</option>
  <option value="3">Relish</option>
</select>

The user can choose how many elements they want and this generates an arrangement ["1", "2", "3"], which you can store or use in the best way.

You can find more information on the developer's website link

    
answered by 08.06.2017 / 15:34
source
3

You can use the select2 plugin which contains many options useful for what you need

$(document).ready(function() {
  $(".js-example-basic-multiple").select2();
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/css/select2.min.css" rel="stylesheet"/>
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/4.0.3/js/select2.min.js"></script>
   <p>Select Multiple</p>
     <select class="js-example-basic-multiple" multiple="multiple">
      <option value="AL">Alabama</option>
      <option value="AL">Alabama</option>
      <option value="WY">Wyoming</option>
     </select>
    
answered by 08.06.2017 в 17:07