1 function check_additem() {
2 var barcodes = document.getElementsByName('barcode');
4 for(i=0;i<barcodes.length;i++){
5 for(j=0;j<barcodes.length;j++){
6 if( (i > j) && (barcodes[i].value == barcodes[j].value) && barcodes[i].value !='') {
7 barcodes[i].className='error';
8 barcodes[j].className='error';
13 // TODO : Add AJAX function to test against barcodes already in the database, not just
14 // duplicates within the form.
17 $(document).ready(function(){
18 $(".cloneItemBlock").click(function(){
19 $(this).parent().parent().clone(true).insertAfter($(this).parent().parent()).find("a.deleteItemBlock").show();
20 var quantityrec = parseFloat($("#quantityrec").attr("value"));
22 $("#quantityrec").attr("value",quantityrec);
25 $(".deleteItemBlock").click(function(){
26 $(this).parent().parent().remove();
27 var quantityrec = parseFloat($("#quantityrec").attr("value"));
29 $("#quantityrec").attr("value",quantityrec);