3 <form name="CalcQtyForm" id="calc_qty_form_id">
5 <input type="hidden" name="input_name" value="[% HTML.escape(input_name) %]">
6 <input type="hidden" name="input_id" value="[% HTML.escape(input_id) %]">
9 <tr><td>[% 'Please insert object dimensions below.' | $T8 %]</td></tr>
15 <tr class="listheading">
16 [% FOREACH col = HEADER %]
17 <th nowrap class="listheading">[% col.column_title %]</a></th>
21 [% FOREACH row = VARIABLES %]
22 <tr class="listrow[% loop.count % 2 %]">
23 <td>[% HTML.escape(row.description) %]:</td><td><input id="[% row.name %]" name="[% row.name %]" value=""></td>
24 <td>[% HTML.escape(row.unit) %]</td>
32 <button type="button" onclick="calculate_qty()">[% 'Calculate' | $T8 %]</button>
35 <script type="text/javascript">
36 function calculate_qty() {
37 [%- FOREACH row = VARIABLES %]
38 var [% row.name %] = kivi.parse_amount($('#calc_qty_form_id #[% row.name %]').val());
40 var result = [% formel %];
41 result = kivi.format_amount(result, 2);
42 if (document.CalcQtyForm.input_id.value) {
43 document.getElementById(document.CalcQtyForm.input_id.value).value = result;
45 document.getElementsByName(document.CalcQtyForm.input_name.value)[0].value = result;
47 $('#calc_qty_dialog').dialog('close');