Forums

Numerical validation

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.
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
You need to login to be able to post a reply.