EDIT: I have figured out that the Javascript problems pertained to data entered in a different question altogether. But that revealed an interesting thing I hadn’t understood -- if the user enters data into a displayed column, and then goes back and edits the question that determines whether the column is hidden, that data doesn’t automatically go away.
Hello!
I managed with a lot of help from this forum to use Javascript in addOnLoad to hide/display columns in a matrix table based on the answer to a question in a previous block. It works so that’s great!
However, if the user goes back to revise their answer to that previous question, when they get to the question with Javascript in the next block, it does not update the hide/display of the columns according to the new answer. It still hides/displays according to the original answer.
I noticed that if the Javascript is attached to a question within the *same* block as the question that it depends on, then it executes just fine no matter how many times the answer is changed.
I don’t know if it is relevant but this survey uses the Table of Contents feature so each block is an entry in the ToC.
Why should it matter that the questions are in different blocks? And is there anything I can do to fix this?