Add Multiple Min/Max Requirements to Text Entry | XM Community
Skip to main content
Solved

Add Multiple Min/Max Requirements to Text Entry

  • April 17, 2023
  • 4 replies
  • 65 views

Forum|alt.badge.img+2

Hello,

 

I have a text entry question and would like to add a warning that if the entered number in this field is not between a certain range.

Specifically, I have the following:

        var initial_judgement = parseInt("${q://QID21/ChoiceTextEntryValue}");

        var algorithm_advice = parseInt("${lm://Field/14}");

        var second_judgement = parseInt("${q://QID24/ChoiceTextEntryValue}");

 

The requirements should look like this:

second_judgement < initial_judgement && second_judgement > algorithm_advice

OR second_judgement > initial_judgement && second_judgement < algorithm_advice

 

If these requirements are not met, then I would like to display a warning on the same page as second_judgement is entered. Such that one does not get redirected to the next page but sees the warning and can either change the second_judgement or click next again and then gets redirected.

 

Is this possible?

Best answer by qualtrics_nerd

Thank you very much! That is indeed very helpful. Is it then also possible to add the validation that participants can only enter a number?

Hi @anleta ,

Yes you can add another line of validation in both logic sets and pass a regex to accept number only.

You can pass this regex in a new logic set.
Hope it resolves your query😊!!!
 

4 replies

qualtrics_nerd
Level 5 ●●●●●
Forum|alt.badge.img+19
  • Level 5 ●●●●●
  • April 17, 2023

Hi @anleta ,

Assuming that second _judgement is the present text box , you can apply below custom validation on the present  text box question :
 



Hope this resolves your query😊!!


 


Forum|alt.badge.img+2
  • Author
  • Level 2 ●●
  • April 18, 2023

Thank you very much! That is indeed very helpful. Is it then also possible to add the validation that participants can only enter a number?


qualtrics_nerd
Level 5 ●●●●●
Forum|alt.badge.img+19
  • Level 5 ●●●●●
  • Answer
  • April 18, 2023

Thank you very much! That is indeed very helpful. Is it then also possible to add the validation that participants can only enter a number?

Hi @anleta ,

Yes you can add another line of validation in both logic sets and pass a regex to accept number only.

You can pass this regex in a new logic set.
Hope it resolves your query😊!!!
 


Forum|alt.badge.img+2
  • Author
  • Level 2 ●●
  • April 19, 2023

Thank you so much, that resolves it! :)