Help with Script for Table Population | Community
Skip to main content
October 3, 2023
Solved

Help with Script for Table Population

  • October 3, 2023
  • 1 reply
  • 812 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by EstebanBustamante

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!

1 reply

EstebanBustamante
Community Advisor and Adobe Champion
EstebanBustamanteCommunity Advisor and Adobe ChampionAccepted solution
Community Advisor and Adobe Champion
October 3, 2023

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