I am trying to select default answers based on embedded data. The problem I have is two-fold:
First, and most importantly: I cannot figure out how to select different values for several different drop-down options in the same Matrix Table.
I found the following online, which lets me select the SAME answer on all dropdowns in the same question (in this example, the second from the bottom):
if($('QID17')) {$$('#QID17 select').each(function(s){ s.value = (s[s.length-2].value); }) }
But how do I adapt this to select different answers for the different drop-downs?
Second, my current JavaScript is long, using "IF embeddeddataX = 1 THEN set answer to 1, IF embeddeddataX = 2 THEN set answer to 2, ..."
I am looking for a more elegant way to use the numeric value from embedded data to set the answer choice.
Any help is appreciated!
Best answer by Rich_Boits_Walker
View original