JavaScript

Select2

Hide search box in select2 dropdown when there are less than 5 options.

$("#id_payment_status").select2({
        placeholder: "Payment Status",
        minimumResultsForSearch: Infinity
});