Numerical validation

Validate a numeric input range in ChronoForms.

Overview

The user needed to create a custom validation rule to ensure a field's value is between 5 and 15.
Define a custom JavaScript validation function that returns true or false based on the value, then reference this function by name in the CF validation rules.

Answered
ChronoForms v6
er ernst@volny.cz 12 Nov, 2020
I'm sorry, but somehow I got lost in regExp's own validation functions and so on.
There are many examples, but I have not found a specific solution in any of them.
Can someone please write me an example, for example as my own validation function, which checks the input to a numeric value of 5 to 10 and display an error message.
I will be very grateful if you write me an example from which I can build.
er ernst@volny.cz 14 Nov, 2020
Answer
I managed to create my own functional pattern:
Javascript:
jQuery.fn.form.settings.rules.maxmin = function(kolik) {
if(kolik < 5 || kolik > 15)
{return false;}
else
{return true;}
}
and i Validation rules
maxmin:message
This topic is locked and no more replies can be posted.