HTML input that can store multiple values?

Asked

Viewed 409 times

2

How can I input similar to the one in this forum? /questions/ask in the tag area, when we insert an example tag: "PHP", and give enter it already saves that value and expects another user.

  • 1

    Ever thought about using a jQuery plugin ? o Select2 do it, look at the examples!

  • 2

    As already stated by @Brunno will depend on how you are working. The html by itself does not perform this function. You will need to work with javascript to get the result. Whether through jquery, or another working method, but you will need another programming for this

  • 1

    Thanks for the answers. I used the plugin Select2 and it worked @Brunno, thank you! I also saw that if we use the "Multiple" in select works well, but with this plugin got better :p. Thanks!

1 answer

3


No Javascript will not be able to implement. I suggest using a jQuery plugin like Select2. Follow the link to example and a basic example:

HTML:

<select class="js-example-basic-multiple" multiple="multiple">
  <option value="SP">São Paulo</option>
  <option value="MG">Minas</option>
</select>

Javascript:

$(".js-example-basic-multiple").select2();

Browser other questions tagged

You are not signed in. Login or sign up in order to post.