Copy Function for Line Items in Quotes

Dear all,

I would like to have a Copy Button for the line items when creating/editing a quote.

What I have done so far is to add a button next to the Add Product Line Button.
(by inserting similar code in the footer section of the insert_group function and copying the function InsertProductLine as function CopyProductLine)

This works fine, I get another product line. Now, how can I fill the fields? I tried by defining variables like:

var product_quantity_c = document.getElementById(‘product_qty’+ prodln).value;

and applying this variable to the value of the appropriate field:

var a = x.insertCell(0);
a.innerHTML = “”;

But now nothing happens when clicking the copy button.

How can I retrieve the values of the former product line and insert those values in the appropriate fields of the added product line?

Thanks,
miri

Solved by myself.

I defined the variables at the beginning and added another function to store the values of the different fields of the actual product line into those variables which give then the values of the copied product line fields.

There is only one item missing:
The field (textarea) for product description is not filling with the appropriate variable. Changing the field to a field like for Quantity or Product Name it will fill, so it seems to be a matter with textarea.

How can I fill the textarea with the product description of the previous product line?

Thanks,
miri