Custom error messages after validate

Hello,

I am trying to find a way to have custom messages on non valid forms. I looked for a solution in the documentation and the forum and I didn’t find much.
The only solution seems to be the use of custom validation functions. After some time spent in the doc, I didn’t understand how the use of custom validation functions could do the trick, specially with ‘data’ being the only parameter.
So, my question, is why don’t you add a method or a callback function in the event ‘onValidateError’ to have custom error message ?
And, how should I use the custom validation functions to replace this lack?

Thanks,

Regards

Hello
Here is a validation demo:
dhtmlx.com/docs/products/dht … ation.html
You can use your custom validation rules. More of it you can use dhtmlxMessage as wrong validation alert.
Documentation:
docs.dhtmlx.com/doku.php?id=dhtmlxmessage:toc&s[]=message
Usage:
dhtmlx.com/docs/products/dht … ples/init/

Thanks for the quick answer but I already read about the dhtmlxMessage and the custom validation rules. Maybe I wasn’t clear enough in my previous question. I would like to know if there is a way to know which rule failed during the validation. This parameter would allow me to set a custom message depending on the failed rule.
I know that this is possible with the grid using the method ‘http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:event_onlivevalidationerror’ or ‘http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:event_onvalidationerror’ because they have a parameter rule that provide the rule that failed during the validation.
Is there anything that could do the same with dhtmlxForm?

Thanks,

Regards.

Ps: I’m using the pro version of dhtmlx suite and the script in the file “dhtmlxForm_dyn.js” is not included in the file ‘dhtmlx.js’ of the folder ‘dhtmlx_pro_full’ which should contain every component. Is that normal ?

Hi

form also have onValidateError event
docs.dhtmlx.com/doku.php?id=dhtm … idateerror

and also demo
dhtmlx.com/docs/products/dht … vents.html
(click validate and check logs)

Ps: I’m using the pro version of dhtmlx suite and the script in the file “dhtmlxForm_dyn.js” is not included in the file ‘dhtmlx.js’ of the folder ‘dhtmlx_pro_full’ which should contain every component. Is that normal ?

actually not. you can just add in your code, write form_dyn.js to end of dhtmlx.js or request updates at our sales department (sales@dhtmlx.com), depending on your used version maybe last option will better.

Thank you !