title: Select2 - disable the user input choice
body: <p>I'm trying to set datas from ajax in a select2 select...</p>
  
  <p>But the problem is that if I write something which isn't in my datas i can select this choice ! </p>
  
  <p><img src="https://i.stack.imgur.com/PfdIV.png" alt="enter image description here"></p>
  
  <p>And this will take this value "I don't exist" ... The formatNoMatches() function seems not to be called ...</p>
  
  <p><strong>JS :</strong></p>
  
  <pre><code>$(".select2-ajax").select2({
  ajax: {
  url: "ajax.call.php",
  type:'POST',
  dataType: 'json',
  data: function (params) {
    return {
      nom: params.term, // search chars
      page: params.page,
    };
  },
  processResults: function (data, page) {
  console.log(data.data);
  if(typeof(data.data)=='undefined' || !data.data || data.data.length &lt;= 0)
    var res = [];
  else
  {
    var res = [];
    for (var i = data.data.length - 1; i &gt;= 0; i--) 
    {
      res.push({"text":data.data[i]["nom"]+' '+data.data[i]["prenom"],"id":data.data[i]["id_salarie"]});
    };
  }
  return { results: res};
  },
  cache: true
   },
  formatNoMatches: function( term ) {
  return "&lt;li class='select2-no-results'&gt;' "+term+" ': Aucun  résultat&lt;/li&gt;";
  },
  
  allowClear: true,
  language: 'fr',
  multiple: false,
  </code></pre>
  
  <p>I tried the two following after seeing <a href="https://stackoverflow.com/questions/15436782/select2-deny-to-can-clean-the-input-field-and-disable-the-form-if-results-not">THIS</a> question : ( but still don't work )</p>
  
  <pre><code>selectOnBlur:false,
  createSearchChoice: false,
  
  
  
  escapeMarkup: function (markup) { return markup; },
  minimumInputLength: 1,
  });
  </code></pre>