We can validate an integer range with integer[0..10] but we can't seem validate a number range as in number[0..10]. Is there a workaround?
Did you find anything?
I ended up satisfying coverage with two separate rules, the semantic number validator and a custom validator that checks if the input value is between two given values.
Attaching custom rules is pretty easy:
$.fn.form.settings.rules.greaterThan = function (inputValue, validationValue) {
return inputValue > validationValue;
}
and to reference it:
rules: [
{
type: 'number',
prompt: 'A valid number is required for: {name}',
},
{
type: 'greaterThan[validationValue]',
prompt: 'Prompt Value',
},
],
Most helpful comment
I ended up satisfying coverage with two separate rules, the semantic number validator and a custom validator that checks if the input value is between two given values.
Attaching custom rules is pretty easy:
and to reference it: