Accessing and Setting Default Values in Matrix Text Box | XM Community
Question

Accessing and Setting Default Values in Matrix Text Box

  • 23 April 2024
  • 0 replies
  • 15 views

Badge

My question, in brief: 

how can I use JavaScript to manually access a text box in a matrix and set its value equal to a particular variable?

 

Additional Details:

In my survey, I have a matrix table with embedded data variables as default values. The embedded data variables are based on how participants respond to an earlier question in the survey (which I’ll call “Q1”).

Upon arriving at the matrix table, subjects can go back in the survey and update their responses to Q1. If they change their responses in Q1, the associated embedded data variables will update. In theory, what I’d like to happen is for the default values in the matrix table to also update accordingly. However, I find that when subjects arrive at the matrix table the second time (after going back in the survey and updating their responses in Q1), the values in the matrix are exactly the same as the first time around. The default choices have not updated.

 

What I think I need to do: as the matrix loads, use JavaScript to manually access each text box in the matrix, and set its value equal to the appropriate embedded data variable. However, I do not know the syntax for accessing these text boxes.

 

If it helps, here is a screenshot of the matrix:

 


0 replies

Be the first to reply!

Leave a Reply