Is it possible to change the message of a select picker, if nothing is selected. For now, 'Nothing selected' is written. I know, the noneSelectedText attribute contains that message.
But I dont want to change it in the bootstrap.select.js. I want to change it dynamically, because I use different select pickers at different locations.
Edit:
Thank you, it works :)
Set title
attribute to your selects.
<select multiple title="Empty" class="selectpicker"> <option>1</option> <option>2</option> <option>3</option> <option>4</option> </select> <select multiple title="No Value" class="selectpicker"> <option>1</option> <option>2</option> <option>3</option> </select>
$('.selectpicker').selectpicker();
JSFiddle
with help of - this I tried it works .
1st step - we have to add data-none-selected-text
attribute in Html select tag. example -
<select name="your_sel_name" multiple class="form-control selectpicker" data-selected-text-format="count" data-none-selected-text >
2nd Step - in js on page load use noneSelectedText
option
example -
$(".selectpicker").selectpicker({ noneSelectedText : 'Please Select' // by this default 'Nothing selected' -->will change to Please Select });
Hope it will Help some-one Thanks!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With