A. Lau A. Lau - 2 months ago 25
jQuery Question

make input text same height as bootstrap selectpicker

I'm trying to make the

input type text
the same size as bootstrap's selectpicker, right now, the input is shorter than the select.

I've tried
$("#selectpicker_picker").height()
but it gives me a much bigger height.

https://jsfiddle.net/zf9cv6jg/

Edit: I can kinda force it by just adding padding, but I was wondering if there was a more accurate way.

Answer

Hello see the below fiddle .As you are using bootstrap it would be better if you use form control

 <form class="form-inline">
 <div class="form-group">
 <label>Name</label>
 <input type="text" class="form-control" placeholder="Name">
 </div>
 <div class="form-group">
 <label>Date:</label>
 <select class='selectpicker'>
 <option value="something">something</option>
 </select>
 </div>    
 </form>

Fiddle Example