Solved
Display Subheaders Using TOC (Table of Contents) and Loop and Merge
Background:
I have a survey that is heavily modified by JavaScript (very much Frankenstein-ed together). I have a loop and merge set up (like 50 loops) that fills in data from previous years and skips the blank loops. So if in the previous year the person answered 4 loops, 4 loops are prefilled with their data, they update the info, and the remaining 46 loops are skipped with display logic.
The Task:
I would like to find a way to hijack the TOC functionality so that in addition to/instead of displaying blocks, it also displays loops that I determine should be seen 1_qid62, 2_qid62, etc. I have managed to add the framework in the header for a beginning custom ordered list but it just inherits the properties of the block, which is fine mostly but I don't know how to redirect the custom list item to a specified loop. When i inspect the link on the toc the anchor is
'<'a id="FL_L3" href="#"'>'.
Do I need to add a custom anchor to the Toc as well or am I in way over my head. The reason I'm even attempting this insanity is become in some cases some of the participants come close to using all 50 loops and sometime they have to jump around or come back to a specif loop to update information.
'<'script type="text/javascript">
Qualtrics.SurveyEngine.addOnload(function()
{
if($('Toc')){
var node = document.createElement("ol");
var textnode = document.createTextNode("Property1");
node.appendChild(textnode);
document.getElementById("FL_L3").appendChild(node);
}
});
</script'>'
Best answer by TomG
@RDurant,
I don’t know if this will help, but a way to control which loops get executed is to loop based off displayed choices in a previous question. In that previous question use choice display logic. Often you would want to hide the question with JS since it’s only purpose is to apply logic to the loop.
View originalLeave a Reply
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.