Validating across questions using JavaScript | XM Community
Skip to main content
Solved

Validating across questions using JavaScript

  • December 8, 2019
  • 3 replies
  • 38 views

Forum|alt.badge.img+4
Question {Age) comes first, then several screens later come question (HowLong), I want to issue an error message if the value of (Howlong) is greater than the value of (Age)

Best answer by npetrov937

Hi, You do not need JS for that. You can use Piped Text and Custom Validation. On your Howlong question, add Custom Validation so that the answer to that question is greater than the value of Age (pull the value of age using Piped Text). Relevant links: https://qualtrics.com/support/survey-platform/survey-module/editing-questions/validation/ https://qualtrics.com/support/survey-platform/survey-module/editing-questions/piped-text/piped-text-overview/ Hope that helps. Nikolay

3 replies

npetrov937
Level 2 ●●
Forum|alt.badge.img+4
  • Level 2 ●●
  • 124 replies
  • Answer
  • December 12, 2019
Hi, You do not need JS for that. You can use Piped Text and Custom Validation. On your Howlong question, add Custom Validation so that the answer to that question is greater than the value of Age (pull the value of age using Piped Text). Relevant links: https://qualtrics.com/support/survey-platform/survey-module/editing-questions/validation/ https://qualtrics.com/support/survey-platform/survey-module/editing-questions/piped-text/piped-text-overview/ Hope that helps. Nikolay

Forum|alt.badge.img+4
  • Author
  • 17 replies
  • December 13, 2019
Thank you very much Nikolay, this opens a great possibilities for this and other situations, your solution is very much appreciated

npetrov937
Level 2 ●●
Forum|alt.badge.img+4
  • Level 2 ●●
  • 124 replies
  • December 17, 2019
Hi @Isam , Great to hear that! Can you please mark the answer as Accepted so that future users can benefit?