-1

I have to limit the max selection in select 2 to one. I familiar with the option maximumSelectionSize: 1, but this option enable the user to enter text to the input/selcect-2 container, and also provide a message with "You can only select 1 item", and I don't need this message, and the user shouldn't be able to enter more text to the input after selected.

Sarit Rotshild
  • 391
  • 3
  • 5
  • 21

1 Answers1

1

Select2's option is default to limit the selection by 1. You don't need to use maximumSelectionSize option. Just call $(".select2").select2();. See example here

chungvh
  • 46
  • 1
  • 4