Expand my Community achievements bar.

SOLVED

Help with Script for Table Population

Avatar

Level 1
Level 1

I am currently working on designing a form with tables that repeat after the user indicates the number of tables needed. These tables are used to record inspections steps for raw material and the user can add as many rows as needed based on the number of inspection steps required for that raw material. The user can also add more tables if there are multiple vendor lots to inspect from the same order. After more tables are populated, I'm wanting to have a question that says, "Same inspection steps as first lot?" If the "yes" radio button is selected, I want the form to automatically populate the table with the same number of rows from the initial table and the same steps that were previously filled out. I already tried adding the action "When radio button "Yes" is clicked, set value of <most recent inspection step cell> to the value of field <initial inspection step cell>". When this action is set, it does populate one of the rows, but will not populate all the rows if more have been added by the user. Any thoughts on a script I could write that would not only fill that cell with the value of the initial cell, but also replicate the number of rows and fill in the values in the cells from each row?

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi, 


This is pure JS functionality and does not require any AEM expertise. I recommend checking JS table plugins that can help you with your requirements. Beyond that, I encourage you to review JS if you are not familiar with it. You can find some helpful resources in the links below.

 

https://flatlogic.com/blog/top-19-remarkable-javascript-table-libraries-and-plugins/ 

https://wpdatatables.com/javascript-table-library/

https://geekflare.com/javascript-table-libraries/

https://www.javascripttutorial.net/

https://www.w3schools.com/js/ 


Hope this helps!



Esteban Bustamante

View solution in original post

1 Reply

Avatar

Correct answer by
Community Advisor

Hi, 


This is pure JS functionality and does not require any AEM expertise. I recommend checking JS table plugins that can help you with your requirements. Beyond that, I encourage you to review JS if you are not familiar with it. You can find some helpful resources in the links below.

 

https://flatlogic.com/blog/top-19-remarkable-javascript-table-libraries-and-plugins/ 

https://wpdatatables.com/javascript-table-library/

https://geekflare.com/javascript-table-libraries/

https://www.javascripttutorial.net/

https://www.w3schools.com/js/ 


Hope this helps!



Esteban Bustamante