How do I show the number of words in text entry boxes? I have several on the page.

DaxDax Provo, UTFounding Community Member CEP (Chief Executive Paw-ficer)

How do I show the number of words in text entry boxes? I have several on the page.

How do I show the number of words in text entry boxes? I have several on the page.

Best Answer

Answers

  • JulieTJulieT WisconsinFounding Community Member, Product Ideas Sage ✭✭✭
    edited November 2017
    1. Select your Text Entry question.
    2. Click on Custom Validation in the right panel.
    3. In the 2nd box, select your question text as the text to analyze.
    4. Pull down the 3rd box and change it from "Equal to" to "Matches Regex"
    5. Paste ^\s(\S+\s+){0,249}\S$ in the last text box. Change the upper number to the limit you choose.
  • AnthonyRAnthonyR Tucson AzFounding Community Member Superuser ✭✭✭✭

    @JulieT said:
    1. Select your Text Entry question.
    2. Click on Custom Validation in the right panel.
    3. In the 2nd box, select your question text as the text to analyze.
    4. Pull down the 3rd box and change it from "Equal to" to "Matches Regex"
    5. Paste ^\s(\S+\s+){0,249}\S$ in the last text box. Change the upper number to the limit you choose.

    This will let you limit the number of words, but it doesn't display the number of words while typing, which is what I think the question is. I'll try and work out the JS for this later today.

  • AkdashboardAkdashboard South CarolinaCommunity Member, Product Ideas Superuser ✭✭✭✭

    @JulieT said:
    1. Select your Text Entry question.
    2. Click on Custom Validation in the right panel.
    3. In the 2nd box, select your question text as the text to analyze.
    4. Pull down the 3rd box and change it from "Equal to" to "Matches Regex"
    5. Paste ^\s(\S+\s+){0,249}\S$ in the last text box. Change the upper number to the limit you choose.

    Has anyone gotten this to work? I can't get the custom validation to work with this logic.

  • ctribucherctribucher North CarolinaCommunity Member Qubie ✭

    I'm struggling with this is well. When I posed this question to Qualtrics Customer Support, they directed me to use embedded data.

    Here's what I was told:

    "Unfortunately Regex expressions and java script are outside of scope of support, and I cannot help you with them, but you can do something different, rather than using a Regex expression, you can create an embedded data and assign the word count in each keyboard event (in the same way that currently you are updating the count), then in the custom validation you can create the logic to pass the validation if embedded data text_length is greater than or equal to 500, it is important to create the embedded data before the block where you are using the java script, in your case you only have one element so the embedded data must be at the very top of the survey flow."

    None of this made any sense to me and I sure would appreciate the help!

  • TomGTomG Raleigh, NCCommunity Member, Product Ideas Wizard ✭✭✭✭✭

    @ctribucher said:
    I'm struggling with this is well. When I posed this question to Qualtrics Customer Support, they directed me to use embedded data.

    Here's what I was told:

    "Unfortunately Regex expressions and java script are outside of scope of support, and I cannot help you with them, but you can do something different, rather than using a Regex expression, you can create an embedded data and assign the word count in each keyboard event (in the same way that currently you are updating the count), then in the custom validation you can create the logic to pass the validation if embedded data text_length is greater than or equal to 500, it is important to create the embedded data before the block where you are using the java script, in your case you only have one element so the embedded data must be at the very top of the survey flow."

    None of this made any sense to me and I sure would appreciate the help!

    It's not you. It doesn't make any sense because embedded data fields don't get updated until you submit the page. So, checking an embedded data field that won't be updated with the applicable data until after you leave the page will never work.

    You should start a new thread with your specific question.

  • ctribucherctribucher North CarolinaCommunity Member Qubie ✭

    Thanks, @TomG! I feel like this should be easier than it is turning out to be. Will start a new thread.

Sign In to Comment