How to add the search form in Bootstrap theme? I am trying to set the search form with submit button in the Navbar as shown in the following image(Following image I have taken from the Bootstrap tutorial page).


  





Now, When we install the default Bootstrap theme from drupal.org it will be ended up like as shown in following image.


  


Now, if I simply move that block to the Navigation bar, it will end
up as shown in following image, which is not a solution for this.



So, I dig out on the bootstrap tutorial
page and found the
following code.


  


So, I can paste that code in the page.tpl.php and can achieve as
shown in following image, BUT it will not search anything, as it is
just a plain HTML code.






How can I achieve that? If CSS is the answer, for now I do not want to go with that. As IMHO, since this display of search form is described as a default on the bootstrap tutorial and in every theme demo display pages, So, there should be some way to enable that, or some way to place that.

Any suggestion or direction? Thanks.
After some search I figure out the following solution, it is working, But the issue is it is applying to search_block_form also, might be function lsubtheme_bootstrap_search_form_wrapper($variables) is the reason, which is getting applied everywhere. Might be giving False positive result. 

PLEASE anybody have any suggestion, how to imptove this, I am trying will update. 

Codes in template.php

function lsubtheme_preprocess_page(&amp;$variables){
  $search_form = drupal_get_form('search_form');
  $search_box = drupal_render($search_form);
  $variables['search_box'] = $search_box;
}

/*
 *  Form alter to add missing bootstrap classes and role to search form.
 */

function lsubtheme_form_alter(&amp;$form, &amp;$form_state, $form_id) {
  if ($form_id == 'search_form') {
    $form['#attributes']['class'][] = 'navbar-form navbar-left';
    $form['#attributes']['role'][] = 'search';
  }
}


function lsubtheme_bootstrap_search_form_wrapper($variables) {

  $output = '&lt;div class="form-group"&gt;';
  $output .= $variables['element']['#children'];
  $output .= ' &lt;div class="form-group"&gt;';
  $output .= '&lt;button type="submit" class="btn btn-default"&gt;Search&lt;/button&gt;';
  $output .= '&lt;/div&gt;';
  $output .= '&lt;/div&gt;';
  return $output;
}


Code in page.tpl.php

 &lt;?php print $search_box; ?&gt;