Hi @MaggieGentry ,NOTE: Assuming the YES option choice is always on 2nd position.I have used the below code and it working for me, please find link below for ithttps://ugamsandbox.yul1.qualtrics.com/jfe/preview/previewId/e53967a1-4d8f-4170-8570-a97393907eb2/SV_1Ic9o4yIj1cKMzc?Q_CHL=preview&Q_SurveyVersionID=current
Hi @snaegelen ,One thing I can suggest is you can store your images in an Multi choice question and add a display logic to it so that it is not displayed during your survey.Save your images in the option choices and use the pipe text of the description eg:${q://QIDXX/ChoiceDescription/1} → 1st image, use this pipe in on the loop and merge and your images would be displayed. Let me know if you have any questions.
Hi @MaggieGentry ,The code you have provided is correct. However, there's a missing closing brace }) at the end of the code.
Hi @csnagy,→ The next button is initially hidden in the above code, that’s why it is disappeared.→ You must have declared it globally at the start of the code due to which the next button is disappeared for all the questions. Enter the JS in between the element of the following, it will only work for the particular question and not the whole survey. Qualtrics.SurveyEngine.addOnReady(function(){ Your JS Code});
Hi @MaggieGentry ,You can use the below JS code which uses a change function. When Yes is selected it will auto advance and when no is selected nothing will get triggered.NOTE: Assuming the YES option choice is always on 2nd position. /*Place your JavaScript here to run when the page is fully displayed*/ jQuery('.ChoiceStructure').find("input[type=radio]").eq(1).change(function() { var yes = jQuery(this).is(":checked"); if (yes) { jQuery("#NextButton").click(); }});
Hi @FelixK ,Assuming the Loop and merge is before the question of above JS. You can use the below JS code to save your Flag value in an embedded data elementId. You can use this embedded data pipe text to display either 1 or the loop value “${lm://Field/9}” wherever you want to display.// Define elementId variable outside conditional blocksvar elementId = ;if (flag==true) { // Set elementId to 1 if flag is true elementId = 1; console.log("The number at the end was replaced with a '1'. ElementId:", elementId);} else { // Set elementId to the Qualtrics piped text variable elementId = "${lm://Field/9}"; console.log("Error: Element with ID not found. ElementId:", elementId);}//Now save the value of variable elementId in an embedded data. Also, declare in survey flow.Qualtrics.SurveyEngine.setEmbeddedData( "elementId", elementId)
Hi @Hilaryacd ,One possible solution for this can be using contact list and JS.First - The contact list should be assigned before the multiple choice question block and Capture those option which you want to be selected as default choices in to embedded data.Second - If they are non numeric, assigned them numeric values based on the recode values of multiple choice question.Third - Select “Allow multiple answers”. Now, Go into JS of multiple choice question and put the below code which will work as default selected choices. Fourth - The below example is to default select the first option of a multiple choice question. You can use a for loop for multiple selections.JS/*Place your JavaScript here to run when the page is fully displayed*/ var i = 1 var val = i; if( val == 1){ this.setChoiceValueByRecodeValue(val,true) }
Hi @varunathi ,Usually this should not happen as the two timer questions should be in different Blocks A and B as you mentioned.To overcome this, I can suggest one solution that you used one Timer question in Block A and use JS in Block B to Display submit and Auto forward.You can use the below code, which will act as a Timer /*Place your JavaScript here to run when the page is fully displayed*/// Hide the NextButton initiallyjQuery("#NextButton").hide();// Schedule to display NextButton after 300 secondssetTimeout(function() { jQuery("#NextButton").show();}, 300000); // 300 seconds = 300,000 milliseconds// Schedule to click NextButton after 600 secondssetTimeout(function() { jQuery("#NextButton").click();}, 600000); // 600 seconds = 600,000 milliseconds
Already have an account? Login
Enter your username or 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.