I need to limit response to a maximum of 500 words. I have no idea what steps to take to do it. I have tried finding the answer in the community. Found one that said to use ^\\s(\\S+\\s+){0,249}\\S$ (which I changed the number to 500), and used the script provided:Qualtrics.SurveyEngine.addOnReady(function(){ 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){ display.update(countWords(textbox.value)); console.log(textbox.value); }});I must be missing a step? Can someone please help me?
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.