Recover Value Chosen Jquery

2

I have two Select Chosen in my form, what I'm doing is:

Thatis,whentypingifIdonotfindanythingrelated,Ihavethe'Incuiritem'link,whichopensamodal,untileverythingworks.

TheproblemisthatIneedtotransferthetypedtexttoaninputthatisinthemodal,Icouldnotdoit,butIbelieveithastodowiththisline,insidethechosen.jquery.jsfile.

returnthis.results_none_found=this.form_field.getAttribute("data-no_results_text") || this.options.no_results_text || "Nada encontrado <br><br> <a href='#' id='chama_modal_motivo_servico' class='chama_modal_motivo_servico' >Incluir este item</a>";

jsFiddle: link

    
asked by anonymous 31.07.2015 / 17:52

1 answer

2

Resolved,

Changing line 886 of chosen.jquery.js. It is possible to retrieve the contents of select with variable, terms. What I did was, get the value of the terms and move to the href of the link.

var valor_input = terms;
no_results_html = $('<li class="no-results"> Nada Encontrado ' + this.results_none_found + ' "<a href="#" id="chama_modal_motivo_servico" class="chama_modal_motivo_servico" data-id="'+ valor_input +'"><span></span></a>"</li>');
    
31.07.2015 / 19:01