<div id="search" class="input-group">
  <input type="text" name="search" value="{{ search }}" placeholder="{{ text_search }}" class="form-control input-lg" />
  <span class="input-group-btn">
    <button type="button" class="btn btn-default btn-lg"><i class="fa fa-search"></i></button>
  </span>
</div>
<script type="text/javascript"><!--
$(document).ready(function() { $('#search input[name=\'search\']').parent().find('button').off('click'); $('#search input[name=\'search\']').parent().find('button').on('click', function() { var url = '{{csp_search_url}}'; var value = $('header #search input[name=\'search\']').val(); if (value) {if (url.indexOf('?') > -1) {url += '&search=' + encodeURIComponent(value);} else {url += '?search=' + encodeURIComponent(value);}} location = url; });});
--></script>