Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

silviomoreto / bootstrap-select [title] attribute

There is an attribute [multiple title] according silvio bootstrap-select documentation:

Here is documentation: https://github.com/silviomoreto/bootstrap-select

<select class="selectpciker" multiple title='Choose one of the following...'>
<option>1</option>
<option>1</option>
</select>

It works well! But I need a single select ( not multiple ) . [title] attribute doesn't works without [multiple] attribute.

I didn't find a single title attribute in silvio bootstrap-select documentation.

Could anyone help me ?

like image 577
Dj.Sunrise Avatar asked Oct 18 '25 13:10

Dj.Sunrise


2 Answers

You can use the data-hidden attribute on the first option..

<select class="selectpicker">
    <option data-hidden="true">Choose one</option>
    <option value="one">One</option>
    <option value="two">Two</option>
    <option value="three">Three</option>
</select>

Working demo: http://www.bootply.com/124596

like image 116
Zim Avatar answered Oct 21 '25 03:10

Zim


This one is work for me and i wish it's work 100% for you also this is done by the title attribute

           <select name="action" id="ActionOnUser" class="selectpicker" title="Action" data-width="auto">
                   <option data-hidden="true"></option>
                   <option value="0">Active</option>
                   <option value="1">Disable</option>
                   <option value="2">Invite Pending</option>
           </select>
like image 20
Uday A. Navapara Avatar answered Oct 21 '25 03:10

Uday A. Navapara



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!