Select2 jquery remove message "please enter 1 or more characters in select2"

4

I want to remove that message, any form?

Here the html:

Here the jquery:

    
asked by EvolutionxD 13.06.2016 в 17:33
source

3 answers

3

You can do it by placing:

minimumInputLength: 2,
formatInputTooShort: "", 

Additionally, you could overload it:

minimumInputLength: 1,
            formatInputTooShort: function () {
                return "Este es mi mensaje";
            }, 
    
answered by 13.06.2016 в 17:44
0

Overwrite the message output using:

  formatInputTooShort: function () {
    return "";
  }

Here I leave a functional jsfiddle: link

    
answered by 13.06.2016 в 17:50
0

This has changed in version 4.0:

language: {
  inputTooShort: function () {
    return 'Mi mensaje.';
  }
}

See formatInputTooShort property not working # 4252 :

  

kevin-brown commented on 18 Mar 2016:

     

Internationalization is one of the many things that changed in Select2   4.0.0.

     

link

     

You can now specify it using language.inputTooShort.

     

link

Launch page:

  

Breaking changes

     

[...]

     

Renamed options

     

[...]

     

Internationalization

formatNoMatches -> language.noMatches
formatSearching -> language.searching
formatInputTooShort -> language.inputTooShort
formatInputTooLong -> language.inputTooLong
formatAjaxError -> language.errorLoading
formatLoading -> language.loadingMore
formatSelectionTooBig -> language.maximumSelected
    
answered by 08.08.2017 в 14:29