Validation for Time (In Hours) Based on Responses to 2 Previous Questions | Experience Community
Skip to main content
Question

Validation for Time (In Hours) Based on Responses to 2 Previous Questions

  • August 24, 2026
  • 2 replies
  • 28 views

Forum|alt.badge.img

Hello! 

Let’s say: I have Q1 which asks what time people usually go to bed (in 24 hour hh:mm format), and Q2 which asks what time people usually wake up (also 24 hour hh:mm format). 

Q3 asks approximately how many hours people sleep on average. If the answer to Q3 is more than the number of hours between Q1 and Q2, I want it to return an automatic error message. 

How do I do this using custom validation or javascript? Thank you in advance!! 

2 replies

nikamshubham73
Level 3 ●●●
Forum|alt.badge.img+4

Hi ​@sumyee_h,

This is doable via the Custom Validation, what question type are you using to differentiate the hh and mm? Is it in a single Text Box? Or two different? 


Forum|alt.badge.img
  • Author
  • August 25, 2026

Hi ​@nikamshubham73! I am using just one form field.