I am using the below javascript to define an array and retrieve random elements from the array. var COST = ["$400","$500","$600","$700","$800"]; var COST_a1 = COST[Math.floor(Math.random()*COST.length)]; alert (COST_a1) ; /* for debugging */ When I preview the survey, Qualtrics runs this piece of code TWICE. The alert box pops up twice with different values for COST_a1. This is causing issues on another page when I try to capture the value of Cost_a1 using this.setChoiceValue(3,COST_a1); I only need the random value to be generated once. Any guidance on this matter is appreciated. Thank you.
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
Sorry, we're still checking this file's contents to make sure it's safe to download. Please try again in a few minutes.
Sorry, our virus scanner detected that this file isn't safe to download.