Remove search from a bootstrap select

0

how to remove the search engine from select of bootstrap ?
select remove search I just want the list to appear.

<div class="form-group col-md-3">
            <label class="control-label">Talla</label>
            <select class="form-control input-sm selectpicker" name="Datos[plan]" data-error="Es un campo obligatorio" data-live-search="true" required="required" id="plan">                           
                  <option value="1">indistinto</option>
                  <option value="2">5</option>
                  <option value="3">7</option>
                  <option value="4">9</option>
              </select>
          </div>

js
$('.selectpicker').selectpicker({style: 'btn-success btn-sm',size: 4,noneSelectedText: 'Seleccionar un elemento', liveSearchPlaceholder:'Buscar',noneResultsText: '¡No existe el elemento buscado!',countSelectedText:'{0} elementos seleccionados',actionsBox:true,selectAllText: 'Seleccionar todos',deselectAllText: 'Deseleccionar todos'});

libraries

    <!-- Bootstrap select js -->
<script src="../../../assets/js/bootstrap/bootstrap-select.min.js"></script>
    
asked by Carlos Enrique Gil Gil 28.11.2017 в 17:57
source

1 answer

1

What you should do is simply set your selectpicker as you wish, the configuration parameters can be seen in Options Bootstrap-Select

Now to disable the search of the select we will use the parameter liveSearch and we will give it a value of false and we will eliminate the parameter liveSearchPlaceholder because we will not need it anymore, leaving your code like this:

$('.selectpicker').selectpicker({
    style: 'btn-success btn-sm',
    size: 4,
    noneSelectedText: 'Seleccionar un elemento',
    noneResultsText: '¡No existe el elemento buscado!',
    countSelectedText:'{0} elementos seleccionados',
    actionsBox:true,
    selectAllText: 'Seleccionar todos',
    deselectAllText: 'Deseleccionar todos',
    liveSearch: false
});
    
answered by 28.11.2017 / 18:18
source