Add new value on Select2 with JS

I need a menu that allows me to search, create and modify values of a related table, the table is called: values

Values of select2


1. Gren

2. Red


Agregar nuevo valor desde el menú select2

Add new value from the select2 menu


3 Blue

The search should show more than 10 thousand records without searching the search.

In stage 1:

The value is searched, if it does not exist, an option of + add appears

In stage 2:

An input appears in the menu to add the new value

In stage 3:

Click on the Save button to save the value in the menu

In stage 4:

Edit and save menu values in the related table.

The example must be show the values of a table, select the value name, save the id and show the data of a related table in the menu.


<script type="text/javascript">


placeholder: 'Select dx',

ajax: {

url: '[login to view URL]',

dataType: 'json',

delay: 250,

processResults: function (data) {

return {

results: data



cache: true


templateResult: function(state) {

if (![login to view URL]) // the ADD don't have id

return $("<div id='newstate' style='display:none;'><span><input type='text' id='textbox'></span><span><button id='save'>SAVE</button></span></div><b class='btn-select-add'>" + [login to view URL] + "</b>");


return [login to view URL];



Skills: Javascript, jQuery / Prototype, AJAX, PHP, CSS

See more: select2 add tags dynamically, select2 createtag, select2 remove selected value, select2 clear options, select2 add selected value, select2 set selected value by text, initialize select2 dynamically, select2 add option if not found, google maps api add marker value, add atributes value zen cart, time value money calculator java script code, aspnet programatically add control value post, add percent value crystal report, javascript checkbox add money value, add additiona value set numbers excel, add beginning selected line numbers shell script, add custom push pin js bing map, add file upload elements js, add text watch characters speak java script, css js banner script

About the Employer:
( 1 review ) NEZAHULCOYOTL, Mexico

Project ID: #20316913

13 freelancers are bidding on average $45 for this job


hi employer, I can help you do this JS adjustment ASAP. kindly reach out to me. I have over 7 years web experience

$25 USD in 1 day
(20 Reviews)

Hello client, I can work on js You can assign me your project I have around 3 plus years of experience with PHP, SQL, HTML, CSS. Recent website developed [login to view URL] Let's connect Thanks Jinank*

$20 USD in 1 day
(20 Reviews)

Dear client. I've read your project description carefully and very interested. I can do this in a few minutes. Let's discuss over chat and get started. Waiting for your reply. Best regards.

$30 USD in 7 days
(26 Reviews)

Hi thanks for your posting. I have read your post. I am a expert who have many experiences in web design&development. In particular, I had great experiences in laravel&codeigniter&Yii&Wordpress&node.js&react.js&angular More

$20 USD in 2 days
(4 Reviews)

Hello, How are you? I hope you are fine. I have saw your descriptions what you want. I would like to work for your project if you want. I have over 5 years of experiences on the development of website. I am ready to s More

$20 USD in 1 day
(7 Reviews)

Hi,Sir! I 'm Alex. Nice to meet you! I read your description. I am a excellent Full-Stack Web development expert. I think your project is very suitable for me. I 'm very interested in your project. I will do best to gi More

$30 USD in 7 days
(8 Reviews)

Hello. I have read your requirements. I am very familiar with PHP, Javascript. I can finish it in an hr surely. I am a new freelancer and never get good reviews. But I promise I will deliver you perfect result sincer More

$30 USD in 1 day
(3 Reviews)

Dear Sir, You have recently advertised for add new valu on select2 with gs . After reading the job description I am confident that I would be a perfect fit for this position as my experience and abilities precisely mat More

$20 USD in 7 days
(6 Reviews)

Hi, We have experienced resources working on projects using latest techniques. We can get the job done as per your requirements keeping the work as per industry standards. We will work with you till you are satisfied. More

$295 USD in 7 days
(1 Review)

Dear i have three year plus experience in web development please give mn one chance.i read your post carefully i build this for you thank you.

$30 USD in 1 day
(0 Reviews)

Hello, I am a software engineer with more than 4 years of experience in web development using javascript. Please share the details with me This will be very simple task to be me.

$10 USD in 7 days
(0 Reviews)

I have made lots of Restful APIs and delivered 5 mobile application being the backend I have rich experience of 3+ Years. I have worked a lot on jquery and Ajax and has very good hands-on PHP. I will see work and comp More

$30 USD in 7 days
(0 Reviews)

Hi There, I can do it very quickly & effectively. I'm having more than 9 years of web development experience. Looking forward to work with you! Thanks!

$20 USD in 7 days
(0 Reviews)