mebil
[kivitendo-erp.git] / js / quicksearch_input.js
1 function on_keydown_quicksearch(event) {
2   var key;
3   var element = $(this);
4
5   if (window.event)
6     key = window.event.keyCode;   // IE
7   else
8     key = event.which;            // Firefox
9
10   if (key != 13)
11     return true;
12
13   var search_term = $(element);
14   var value       = search_term.val();
15   if (!value)
16     return true;
17
18   var url = "ct.pl?action=list_contacts&INPUT_ENCODING=utf-8&filter.status=active&search_term=" + encodeURIComponent(value);
19
20   window.location.href = url;
21
22   return false;
23 }
24 $(function(){ $('#frame_header_contact_search').keydown(on_keydown_quicksearch) });