custom Error messages for custom server side validation

stijnst 19 Apr, 2020
Hello

Building further upon this old question: I have some validations to do that seems to be too complex to use the built in validation (combining different fields, and calculations with dates). I can successfully check them using a PHP block, and an event switcher block to return the user to the form, or proceed with storing the data in the database.
However, what I'm still trying to figure out: How can I make an error message appear next to the data field that causes the validation to fail?

in Chronoforms v4 the following was possible:
$form->validation_errors['myFormField'] = "Please correct this field";
what's the v6 equivalent?

Kind regards

Stijn
Max_admin 19 Apr, 2020
There is a custom error message in v6, did you try to put your message there ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
stijnst 19 Apr, 2020
Answer
1 Likes
Nevermind. This seems to do the trick:
$this->errors['myFormField']="Please correct this field";
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger