I am using Javascript to replace images in a series of matrix table questions, following the procedure described here.
For some of the questions, the images are not being replaced when the page initially loads. If I click the "next" button, causing Qualtrics to prompt me to answer the question, the image will then consistently be replaced. This makes me suspect that the Javascript is executing before there is an image to be replaced or that I am experiencing a redraw problem as reported here.
Is there a way to more consistently replace images or to trigger the same refresh that is being done when Qualtrics prompts for the question to be answered?
Javascript (same results if I put it in the OnLoad or OnReady sections):
var count = Number("${e://Field/count}");
var files = Qualtrics.SurveyEngine.getEmbeddedData('block_all');
file = files[count]
path = "https://sipacolumbia.co1.qualtrics.com/ControlPanel/Graphic.php?IM=" + file ;
var img = document.getElementById("imgdir");
img.src = path;
Qualtrics.SurveyEngine.setEmbeddedData("count", count + 1);
Question html (before replacement of image url):
Javascript sometimes fails to replace image without refresh
Sign up
Already have an account? Login
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login to the Community
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join.
No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Login with Qualtrics
Welcome! To join the Qualtrics Experience Community, log in with your existing Qualtrics credentials below.
Confirm your username, share a bit about yourself, Once your account has been approved by our admins then you're ready to explore and connect .
Free trial account? No problem. Log in with your trial credentials to join. No free trial account? No problem! Register here
Already a member? Hi and welcome back! We're glad you're here 🙂
You will see the Qualtrics login page briefly before being taken to the Experience Community
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
