Forums

js validation with CFv6

ernst@volny.cz 14 Jun, 2021
I can in the validation function
(jQuery.fn.form.settings.rules.functionname = function (value, param)
enter error message text?

So change the text entered here?
functionname:error message
GreyHead 15 Jun, 2021
Hi Ernst,

If I remember correctly the error message is one of the field parameters so you can add JavaScript to change the value of the parameter.

Bob
ernst@volny.cz 15 Jun, 2021
Thank you for the advice.
But I don't know how to find out which parameter it is and how to change it.
GreyHead 16 Jun, 2021
Hi ernst,

Here's an example of the code from a demo contact form


data-validationrules="{"identifier":"first_name_id-main","rules":[{"type":"empty","prompt":"Please enter your first name"},{"type":"required","prompt":"xxx"}]}"
It is the text xxx that would need to be changed by your JavaScript.

Bob
ernst@volny.cz 17 Jun, 2021
Thank you for the advice.
I mainly wrote in connection with the fact that when I enter 2 validation rules, the error message is displayed only from the rule that occurs first.

viz. https://www.chronoengine.com/forums/posts/t109443/error-message-in-validation-rules

Is there another way to fix this than to rewrite the error text with javascript?
ernst@volny.cz 17 Jun, 2021
Thank you for the advice.
I mainly wrote in connection with the fact that when I enter 2 validation rules, the error message is displayed only from the rule that occurs first.

viz. https://www.chronoengine.com/forums/posts/t109443/error-message-in-validation-rules

Is there another way to fix this than to rewrite the error text with javascript?
You need to login to be able to post a reply.