+ if (document.CalcQtyForm.input_id.value) {
+ document.getElementById(document.CalcQtyForm.input_id.value).value = result;
+ } else {
+ document.getElementsByName(document.CalcQtyForm.input_name.value)[0].value = result;
+ }
+ $('#calc_qty_dialog').dialog('close');