0
individualproduct = @All of Transaction Product Name+'';
productitem= individual_product.split(',');
individual_quantity = @All of Transaction Quantity+''
quantityitem = individualquantity.split(',')+'';
for(count=0;count<productitem.length;count++)
{
var combine += productitem[count]+'' + quantity_item[count]+'';
}

It does not work. If we do it like :

for(count=0;count<productitem.length;count++)
{

productitem[count]+'' + quantity_item[count]+'';
}

It does not show an error. but through this, I can only get value at last index. we are expecting to get them all.

1 Answers1

0

I am not sure what are you trying to achieve, what do you need to do?

When you assign @All of Transactional Product Name to individualproduct, you can't append ' ' since it's an array. Same for individual_quantity.

Is this what you wanted?

individualProduct = @All of Product Name;
individualQuantity = @All of Quantity;

var combine = '';
for(i = 0; i < individualProduct.length; i++) {
   combine += individualProduct[i] + ' ' + individualQuantity[i] + ' ';
}

combine;

First two lines, you get a reference to the names and quantities. Then, you iterate through each item, combining the name and the quantity.

albertfdp
  • 425
  • 4
  • 11