Thanks Rondev. Interestingly, your code works perfectly for the web version but again it has an issue with the mobile version but this time the opposite! It never shows the next button, even after going above the word limit, on the mobile version.
Thanks Rondev for your response. I will look into regex solution as well.Here is the code I'm using:Qualtrics.SurveyEngine.addOnload(function(){ /*Place your JavaScript here to run when the page loads*/ $('NextButton').hide();});Qualtrics.SurveyEngine.addOnReady(function(){ /*Place your JavaScript here to run when the page is fully displayed*/ var display = $('wordCountDisplay'); var questionID = this.questionId; var textbox =$('QR~' + questionID); var that = this; function countWords(s){ s = s.replace(/\\n/g,' '); // newlines to space s = s.replace(/(^\\s*)|(\\s*$)/gi,''); // remove spaces from start + end s = s.replace(/[ ]{2,}/gi,' '); // 2 or more spaces to 1 if(s == ''){ return 0; }else{ return s.split(' ').length; } } textbox.onkeyup = function(e){ var currWords = countWords(textbox.value) display.update(currWords); console.log(textbox.value); if (currWords <
Thank you so much for your response TomG . Actually I'm new to Qualtrics, so I don't know whether I'm thinking in the right way or not. But the reason I'm asking this question is that I want to design a survey for an experiment with the following description:The study has 12 scenarios in total. Each scenario has two versions/conditions: conditionA and conditionB. I want each subject to see all the 12 scenarios in random order, with half of the scenarios shown in their conditionA and the other half shown in conditionB. The order of the conditions are also randomized. Therefore, each subject sees 6 randomly chosen scenarios in conditionA and the remaining 6 scenarios in conditionB with random order.I was wondering whether I can achieve the randomization with something like javascript and then set the value of embedded data to the name of the blocks containing each scenario I want to show to each participant (in the order generated by the code) and then use the name of the block to displa
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.