How to sum "side by side" answer inputs on same page using JavaScript | XM Community
Skip to main content

I am attempting to get the final cells under each column in a two-column side-by-side question type to display the sum of the values entered by respondents in the above cells for each column. If I try to use embedded data references to accomplish this then the summing cells remain blank because the embedded data answers aren't saved until the respondent clicks onto the next page.
I have virtually zero experience coding in JavaScript but my understanding is that referencing specific answer inputs, summing them, and displaying them on the same page should be possible with some relatively straightforward code. If anyone could provide me with an example of how such code would be structured (or even what functions to use to reference submitted answers) that would be a huge help!
Thanks!

We need to use input event on column text boxes which on every input calculate the sum of all rows of respective column through loop.


Leave a Reply