I need to ask 4 open-ended numeric questions on the same page and to avoid nonsensical answers I need to show a customized error message above each question if the value is greater than the previous one (after the second), so that :
If the value on Q1 < cutoff point, it says "Please enter a value greater than #"
if the value of Q2<Q1, it says "Please enter a greater value than in Q1".
if the value of Q3<Q2, it says "Please enter a greater value than in Q2".
if the value of Q4<Q3, it says "Please enter a greater value than in Q3".
I need the logic across all 4 questions to Q1<Q2<Q3<Q4.
The respondent should not be able to continue until all those conditions are met on the same page.
Could anybody share a code to do this with javascript or Perl?