I need to add “Add new item” option in Select2
-
I need to add “Add new item” option in Select2
-
I need to add “Add new item” option in Select2
-
I need to add “Add new item” option in Select2
This is a place to ask questions, not just tell us what you want to do. What did you expect us to tell you?
Social Media - A platform that makes it easier for the crazies to find each other. Everyone is born right handed. Only the strongest overcome it. Fight for left-handed rights and hand equality.
-
I need to add “Add new item” option in Select2
Can you please put some code or something so that people can help you - if you say like I want to create a project - how would someone knows what should he create - just like that ask where are you stuck after attempting couple of times etc. Good luck.
-
I need to add “Add new item” option in Select2
Add new type
Car
BUS
TWO
THREE<pre>$(function () { $(".select2") .select2({ placeholder: 'Select type', width: '50%', minimumResultsForSearch: Infinity }) .on('select2:close', function() { var el = $(this); if(el.val()==="NEW") { var newval = prompt("Enter new value: "); if(newval !== null) { el.append('<option>'+newval+'</option>') .val(newval); } } }); });</pre>