回答

0

你的意思是要禁用特定的搜索框中選擇?

Chosen有一個disable_search_threshold選項,可用於禁用搜索框,如果有小於n結果。

https://harvesthq.github.io/chosen/#hide-search-on-single-select

例如:

$(".chosen-select").chosen({disable_search_threshold: 10}); 

將禁用框,如果有小於10個選項。

如果你想永遠禁用它我想你可以只設置一個非常高的數字:

$(".chosen-select").chosen({disable_search_threshold: 999999}); 

這是你在找什麼?

+0

謝謝你的回答,但我解釋你整個場景,我想只選擇一個選項,我可以很容易地選擇,但我可以鍵入也在同一個文本框,我需要禁用,所以用戶無法鍵入後,他從下拉菜單中選擇選項,如果可以,請提供幫助。 – user3653474

+0

請參閱https://harvesthq.github.io/chosen/#standard-select – user3653474

+0

中的多重選擇。很抱歉,我無法完全理解您想要的內容。請張貼一些示例代碼,理想情況下使用JS小提琴。 – beercohol