EventSwitcher

display custom validation errors in ChronoForms EventSwitcher.

Overview

The issue occurs when using an outdated variable to store error messages in CF v5.
Replace the deprecated validation_errors variable with the correct errors variable in your PHP code to ensure custom error messages appear and the form reloads properly.

Answered
ca caratti 05 May, 2014
I am using EventSwitcher to validate fields (checksum and other rules).
When no erros is found by my php code the form works fine (event success). However, if an error is identified by my php code, no error message is shown (event fail).

Exemple:

if ($result->qtd >= 1) {
$form->validation_errors['usuario'] = 'My error message!';
return 'fail';
}

How can I show the erro 'My error message!' and other errors and also reload the form?

Ricardo.
Max_admin Max_admin 05 May, 2014
Answer
Hi Ricardo,

Instead of using "$form->validation_errors", please use "$form->errors" in v5

Regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
ca caratti 05 May, 2014
Thanks Max,
it is working now.

Ricardo.
This topic is locked and no more replies can be posted.