7

So what I have right now is this:

SAMPLE

But I want to include icon-search ICON SEARCH inside the textbox on the left side.

This is my code:

<form class="navbar-form pull-left form-search">
    <select>
        <option>Search patient by...</option>
        <option name="fname">Firstname</option>
        <option name="fname">Lastname</option>
        <option name="fname">Last follow up</option>
    </select>
    <div class="input-append">
        <input data-provide="typeahead" data-items="4"  type="text" 
           class="span2 search-query">
        <button class="btn">Search</button>
    </div>
</form>

So any ideas how to achieve this? Thanks.

icedwater
  • 4,701
  • 3
  • 35
  • 50
neknek mouh
  • 1,802
  • 8
  • 27
  • 58

3 Answers3

4
<input data-provide="typeahead" data-items="4"  type="text" class="search-query">

.search-query{
   background: url(../images/your_pic.format) no-repeat left ;
}

Just add that image as background aligned left with no-repeat

Alessandro Fazzi
  • 1,308
  • 3
  • 12
  • 11
RbG
  • 3,181
  • 3
  • 32
  • 43
2

Check this Fiddle

<form class="navbar-form pull-left form-search">
  <div class="input-append">
    <input data-provide="typeahead" data-items="4"  type="text" class="span2 search-query" style="background:url(http://twitter.github.io/bootstrap/assets/img/glyphicons-halflings.png) no-repeat -38px 9px">
    <button class="btn">Search</button>
  </div>
</form>

As you can see there are other icons also showing. You have to use separate "search image" for your textbox.

Pier-Luc Gendreau
  • 13,553
  • 4
  • 58
  • 69
0

you can do something like :

HTML :

<form class="navbar-form pull-left form-search">
<div class="input-append">
  <i class="icon-zoom-in"></i>
        <input data-provide="typeahead" data-items="4"  type="text" 
           class="span2 search-query">
        <button class="btn">Search</button>
    </div>
  </form>

CSS :

.icon-zoom-in
{
  position:relative;
  left:20px;
  top:-8px;
  z-index:999;
}

try it : https://refork.codicode.com/xb70

Chtioui Malek
  • 11,197
  • 1
  • 72
  • 69