calculate_qty (Formel): Input- und Formel-Feld auch als Dom-Id übergeben können
[kivitendo-erp.git] / js / calculate_qty.js
1 function calculate_qty_selection_window(input_name, input_id, formel_name, formel_id) {
2   var parm = centerParms(600,500) + ",width=600,height=500,status=yes,scrollbars=yes";
3   var action = "calculate_qty";
4   if (formel_id) {
5     var formel = $('#' + formel_id).val();
6   } else {
7     var formel = $('[name="' + formel_name + '"]').val();
8   }
9   url = "common.pl?" +
10     "INPUT_ENCODING=UTF-8&" +
11     "action=" + action + "&" +
12     "input_name=" + encodeURIComponent(input_name) + "&" +
13     "input_id="   + encodeURIComponent(input_id)   + "&" +
14     "formel=" + encodeURIComponent(formel);
15   //alert(url);
16   window.open(url, "_new_generic", parm);
17 }