Thanks for this. I've proposed this feature a while ago, but just wanted to get it circulating again. Why not have a built in min
and max
parameter to number fields which automatically triggers this label --> goto behavior? For example... right now I have to do something like this for basic numeric field validation:
*label: birth_validate
*question: What is the year of your birth?
*type: number
*save: birth
*throwaway
--Validate birth date
*if: birth < 1900 or birth > 2002
You must enter a valid birthdate
*goto: birth_validate
This is a lot of code and makes the overall codebase less readable. It would be much more parsimonious to have a min and a max parameter like so:
*label: birth_validate
*question: What is the year of your birth?
*type: number
*min: 1900
*max: 2002
*save: birth
*throwaway
Then the form would automatically yield the label "Must be greater than 1900" or "Must be less than 2000" depending on the user's input.
This would also be preferable since it would allow you to validate multiple fields within a *page. Right now, you can't validate forms (as far as I'm aware) if you have multiple questions on the same page and one of them requires validation.