]> wagnertech.de Git - mfinanz.git/blobdiff - js/quicksearch_input.js
Erzeugnissuche
[mfinanz.git] / js / quicksearch_input.js
index 055b5f31a7a622d525179e1413d30063d71ff9ef..02e4cf3ea061788ae658ce3f840180c347c16921 100644 (file)
@@ -1,5 +1,6 @@
-function on_keydown_quicksearch(element, event) {
+function on_keydown_quicksearch(event) {
   var key;
+  var element = $(this);
 
   if (window.event)
     key = window.event.keyCode;   // IE
@@ -14,10 +15,16 @@ function on_keydown_quicksearch(element, event) {
   if (!value)
     return true;
 
-  var url = "ct.pl?action=list_contacts&INPUT_ENCODING=utf-8&filter.status=active&search_term=" + encodeURIComponent(value);
+  url = {
+    frame_header_contact_search: "ct.pl?action=list_contacts&INPUT_ENCODING=utf-8&filter.status=active&search_term=",
+    frame_header_parts_search:   "ic.pl?action=generate_report&INPUT_ENCODING=utf-8&searchitems=assembly&all="
+  }[element.attr('id')];
 
-  search_term.val('');
-  window.location.href = url;
+  window.location.href = url + encodeURIComponent(value);
 
   return false;
 }
+$(function(){
+  $('#frame_header_contact_search').keydown(on_keydown_quicksearch);
+  $('#frame_header_parts_search').keydown(on_keydown_quicksearch);
+});