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

Question

Question

Replicate Row in table

asked on September 2, 2020

Hello,

In Cloud I have tried to assign a field in Table with CLASS, however for some reason the field is not getting the class assigned...

The desired outcome is that when the value is selected in first row, all added rows should by default get the value from above row.

The field has values being populated from Lookup.

I could manage this script, any help is Highly appreciated...

Which I got from: https://answers.laserfiche.com/questions/98885/Copy-row-value

$(document).ready(function () {

$(document).on('click', '.cf-table-add-row', function(){
":visible" selector as $('#q54 input').last().val($('#q54 input:visible:eq(-2)').val());
 });
  
  });

Thanks,

0 0

Answer

SELECTED ANSWER
replied on September 4, 2020 Show version history

hi Sonia,

ID attribute for field inside table is different than simple field. Please check Javascript documentation

https://www.laserfiche.com/support/webhelp/Laserfiche/10/en-US/administration/#../Subsystems/Forms/Content/Javascript-and-CSS/Javascript%20Selectors.htm

Targets an input box in a table. The ID attribute for input boxes in table rows has the format FieldFieldNumber(RowNumber).

 

I tried with following script and it works. You need to find a proper way to locate target field.

$(document).ready(function () {
  $(document).on('click', '.cf-table-add-row', function(){
    $('[id^="Field1"]').last().val($('[id^="Field1"]:eq(-2)').val());
   });
});
0 0

Replies

replied on September 2, 2020

Any help?

0 0
replied on September 4, 2020

Awesome!!!

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

Sign in to reply to this post.