+
+
+<%= include('/elements/xmlhttp.html',
+ 'url' => $p. 'misc/xmlhttp-cust_main-search.cgi',
+ 'subs' => [qw( custnum_search smart_search )],
+ )
+%>
+
+<SCRIPT TYPE="text/javascript">
+
+ var rownum = <%= $row %>;
+
+ function addRow() {
+
+ var table = document.getElementById('OneTrueTable');
+ var tablebody = table.getElementsByTagName('tbody').item(0);
+
+ var row = document.createElement('TR');
+
+ var custnum_cell = document.createElement('TD');
+
+ var custnum_input = document.createElement('INPUT');
+ custnum_input.setAttribute('name', 'custnum'+rownum);
+ custnum_input.setAttribute('id', 'custnum'+rownum);
+ custnum_input.setAttribute('size', 8);
+ custnum_input.setAttribute('maxlength', 12);
+ custnum_input.setAttribute('rownum', rownum);
+ custnum_input.onfocus = clearhint_custnum;
+ custnum_input.onchange = search_custnum;
+ custnum_cell.appendChild(custnum_input);
+
+ row.appendChild(custnum_cell);
+
+ var customer_cell = document.createElement('TD');
+
+ var customer_input = document.createElement('INPUT');
+ customer_input.setAttribute('name', 'customer'+rownum);
+ customer_input.setAttribute('id', 'customer'+rownum);
+ customer_input.setAttribute('size', 64);
+ customer_input.setAttribute('value', '(last name or company)' );
+ customer_input.setAttribute('rownum', rownum);
+ customer_input.onfocus = clearhint_customer;
+ customer_input.onclick = clearhint_customer;
+ customer_input.onchange = search_customer;
+ customer_cell.appendChild(customer_input);
+
+ var customer_select = document.createElement('SELECT');
+ customer_select.setAttribute('name', 'cust_select'+rownum);
+ customer_select.setAttribute('id', 'cust_select'+rownum);
+ customer_select.setAttribute('rownum', rownum);
+ customer_select.style.color = '#ff0000';
+ customer_select.style.display = 'none';
+ customer_select.onchange = select_customer;
+ customer_cell.appendChild(customer_select);
+
+ row.appendChild(customer_cell);
+
+ var paid_cell = document.createElement('TD');
+
+ var paid_text = document.createTextNode('$');
+ paid_cell.appendChild(paid_text);
+
+ var paid_input = document.createElement('INPUT');
+ paid_input.setAttribute('name', 'paid'+rownum);
+ paid_input.setAttribute('size', 8);
+ paid_input.setAttribute('maxlength', 8);
+ paid_cell.appendChild(paid_input);
+
+ row.appendChild(paid_cell);
+
+ var payinfo_cell = document.createElement('TD');
+ var payinfo_input = document.createElement('INPUT');
+ payinfo_input.setAttribute('name', 'payinfo'+rownum);
+ payinfo_input.setAttribute('size', 10);
+ payinfo_cell.appendChild(payinfo_input);
+ row.appendChild(payinfo_cell);
+
+ var error_cell = document.createElement('TD');
+ error_cell.style.backgroundColor = '#e8e8e8';
+ row.appendChild(error_cell);
+
+ tablebody.appendChild(row);
+
+ rownum++;
+
+ }
+
+</SCRIPT>
+