use by: Including the code content in your custom code block. Then add binding code like the one shown below into your custom code block, in order to link the validation to a given FormAssembly field. Note the order of parameters is field_id, largest_value, smallest_value.
wFORMS.behaviors.validation.messages.template_isInRange = "The value provided is not in the range between %%1%% and %%2%%"; wFORMS.behaviors.validation.messages.isInRange = "The value provided is not in the range between %%1%% and %%2%%";
I have also had good luck using regular expressions to enforce numerical ranges. Harder to write, yes, but it's built-in and you don't have to inject any more code.
Yup, but I always feel a bit bad handing non-programmers / power users something like: # 1 or 001..999: ^(0{0,2}[1-9]|0?[1-9][0-9]|[1-9][0-9][0-9])$ http://www.regular-expressions.info/numericranges.html
It's sort of an abuse of the regex power. Of course the code Ive provided is abusive in its own right as it relies on the order of class attributes, which I believe is not officially guaranteed.
You pays your moneys and takes your chances. Drew.