How to add a new options by user to Select2 dropdown

If you want to give user can add new options to select tag in runtime, you can use Select2 jQuery library to do it.

Final result is like this:

Select2 Dropdown

1. Enable tags option

2. Handle createTag function to add extra properties

3. Update templateResult function to display “(new)” text inside of item

References

zemna

Programmer/Web/Mobile/Desktop

You may also like...

Leave a Reply