<buttontype="button"id="sort_button_date"class="btn btn-default"title="Use the 'Date' ranking profile, ordering results by default on each document last modification date."
onclick="document.getElementById('search').value=document.getElementById('search').value + ' /date';document.searchform.submit();">Sort by Date</button>
</div>
</div>
<script>
if (document.getElementById('search').value.indexOf(" /date") == -1) {