MOON
Server: Apache
System: Linux nserver.cafsindia.com 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: cafsindia (1002)
PHP: 8.2.30
Disabled: NONE
Upload Files
File: /home/cafsindia/hrms_patroniss_com/dist/select2/docs/_includes/examples/multiple-max.html
<section>
  <h1 id="multiple-max">
    Limiting the number of selections
  </h1>

  <p>
    Select2 multi-value select boxes can set restrictions regarding the
    maximum number of options selected. The select below is declared with
    the <code>multiple</code> attribute with <code>maximumSelectionLength</code>
    in the select2 options.
  </p>

  <div class="s2-example">
    <p>
      <select class="js-example-basic-multiple-limit js-states form-control" multiple="multiple"></select>
    </p>
  </div>

{% highlight js linenos %}
$(".js-example-basic-multiple-limit").select2({
  maximumSelectionLength: 2
});
{% endhighlight %}
</section>