admin管理员组

文章数量:1335448

I am using /. I am using multi-select dropdown. On selecting some items, it shows its default title "x items selected". I want to change its text to "x some_other_word selected.". Anyone tell me, if this plugin provides any option to change the title text.

I am using https://silviomoreto.github.io/bootstrap-select/. I am using multi-select dropdown. On selecting some items, it shows its default title "x items selected". I want to change its text to "x some_other_word selected.". Anyone tell me, if this plugin provides any option to change the title text.

Share Improve this question asked Nov 2, 2015 at 10:28 sanjeev1779sanjeev1779 781 silver badge8 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 5

you can use "data-count-selected-text"

<select class="selectpicker" multiple data-selected-text-format="count>3"
    data-count-selected-text= "{0} some_other_word selected">
     <option>Mustard</option>
      <option>Ketchup</option>
      <option>Relish</option>
      <option>Onions</option>
</select>

Instead of using the "count format" use

<select class="selectpicker" multiple data-selected-text-format="count>3">
 <option>Mustard</option>
  <option>Ketchup</option>
  <option>Relish</option>
  <option>Onions</option> </select>

or you can directly edit the plugin and add extended option to define your default "selected" text format.

Add title value to "x some_other_word selected".

 <select class="selectpicker" title="x some_other_word selected.">
<option>Mustard</option>
<option>Ketchup</option>
<option>Relish</option>
</select>

本文标签: javascriptSelectpicker title change textStack Overflow