Custom validation with a requested response | XM Community
Skip to main content

I have participants in a survey doing a writing task. I'd like to give the participants a warning if they try to submit the page with less than the required number of words, but not force them to write the required amount. I'd also like to have a 5 minute timer where the page auto advances after 5 minutes.
I'm not having any trouble writing the validation itself, and I am able to rely on a Timer question for the time auto advance, but I am not sure what the right way to do the word count validation is. Right now I am considering something along the lines of:
Qualtrics.SurveyEngine.addOnPageSubmit(function()
{
    if( numOfWords < min_n_word-1 ){
       alert("Submit more words!")
    }
});
but this is flawed because it doesn't stop the page submission.

How can I add a warning message for page submission that allows participants to submit with less than the minimum number of words that also allows the timer to auto advance the page?

Also see:
https://www.qualtrics.com/community/discussion/10788/have-auto-advance-ignore-validation-rules

Use JS to add a fake Next button to the page and hide the real one. Then have your JS control what happens when the fake Next button is clicked. Instead of using alert you can use confirm.


Leave a Reply