Qualtrics.SurveyEngine.addOnload(function(){
function compute_total(){
//some computations with embedded data field happen here
}
function drawChart(){
//some chart elements are updated here
}
jQuery("input[type=radio]").click(compute_total);
jQuery("input[type=radio]").click(drawChart);
}
And this works just fine. However, I also want both these functions to run just once when the page loads. And I'm not sure how to do that. window.onload doesn't work in Qualtrics. I tried the following:
Qualtrics.SurveyEngine.addOnload(function(){
function compute_total(){
//some computations with embedded data field happen here
}
function drawChart(){
//some chart elements are updated here
}
jQuery("input[type=radio]").click(compute_total);
jQuery("input[type=radio]").click(drawChart);
compute_total();
drawChart();
}
But that doesn't work either. Any idea how to get this done?
Thanks!
Best answer by avikram
View original