You are viewing limited content. For full access, please sign in.

Question

Question

Drop down list resets to default value

asked on November 24, 2020

I have created a table and a button on Laserfiche forms, when you click on the button it clones the table however if I select a value from the drop down list it goes back to default value in the copied table. 

  $('.cls_SourceTable tbody tr').each(function(i,tr) {
    
var rowFromSourceTable = $(this);
      Payment_Value = tr.cells[6].children[1].children[0].value;

//Check if the amount value is greater that 0 before clonning
      if(Payment_Value > 0)
      {
        // .. Take a clone/copy of it ..
       var clonedRowFromSourceTable = rowFromSourceTable.clone();
       total = parseFloat(Consumed) + parseFloat(Payment_Value);
       tr.cells[8].children[1].children[0].value =total;
        
       
        amount = tr.cells[4].children[1].children[0].value;

 

0 0

Replies

replied on November 24, 2020

Each <select> has a set of <options> you'll need to copy over all those options first then set the value on destination table once they're all copied over.

I'm curious as to what your use case for this is, as it seems a bit odd. If the goal is to automagically generate a new row why not utilize the add link and trigger a click event on that and then copy the values needed from the prev row to the newly added row? 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.