error message in validation rules

Display only the first validation error message in ChronoForms.

Overview

The issue occurs because CF shows only the error from the first validation rule that fails, even if multiple rules are applied.
Use a single custom JavaScript validation function to check all conditions and return a unified error message.

Answered
ChronoForms v6
er ernst@volny.cz 14 Jun, 2021
If I apply more than one rule, for example: [pre]regExp[/^[^0-9]+$/]:May not contain numbers
maxLength[10]:Must be less than 10[/pre]
it is written constantly, the error text of the rule that occurred first.
For example, I will state a number in the text, it will not say "May not contain numbers".
I delete the number and error disappear. I will extend the text beyond 10 characters, but the same error will still be displayed. ("May not contain numbers").

If the text is longer than 10 first after loading the form, it will be exactly the opposite.

I tried it despite the js function, but it's the same.

can be used as a function:
jQuery.fn.form.settings.rules.customfn = function(value, param) {
......
return false/true
do I set the error message text? This would use only one function and set the texts in it.[br]That would solve the problem.
teldrive teldrive 07 Aug, 2021
Answer
hi , not sure if this helps,
but it worked for my in extra attributes, this masks force to write only some numbers

data-inputmask:'mask':['10.00','09.99']
type=dec
------------------
data-inputmask:'mask':['1.00','0.99']
type=dec
-------------------
data-inputmask:'mask':['2.50','2.49','2.39','2.29','2.19','2.09','1.99','0.99']
type=dec
This topic is locked and no more replies can be posted.