Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I allow spaces to be input in Bootstrap Select?

I want to be able to type a space (keycode=32) but bootstrap-select does not let me type it. Any idea how I can allow spaces to be input?

I'm using v1.11.0

Bootstrap-select v1.11.0

like image 733
Kamilski81 Avatar asked Sep 05 '18 17:09

Kamilski81


People also ask

How do I change the width of a bootstrap select?

Width. Wrap selects in grid columns, or any custom parent element, to easily enforce desired widths. Alternatively, use the data-width attribute to set the width of the select. Set data-width to 'auto' to automatically adjust the width of the select to its widest option.

What is the use of bootstrap select?

Bootstrap Select is a form control that shows a collapsable list of different values that can be selected. This can be used for displaying forms or menus to the user. This article shows the methods by which a <select> element can be styled in Bootstrap, using both custom styles and bootstrap-select.


1 Answers

May be something else is preventing you from entering space, bootstrap-select does no prevent your from entering spaces, checkout demo below:

<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.11.0/css/bootstrap-select.min.css" rel="stylesheet"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.11.0/js/bootstrap-select.min.js"></script>


<select class="selectpicker" data-live-search="true">
  <option>Hot Dog, Fries and a Soda</option>
  <option>Burger, Shake and a Smile</option>
  <option>Sugar, Spice and all things nice</option>
</select>
like image 147
Dipen Shah Avatar answered Oct 31 '22 16:10

Dipen Shah