I have made a simple validation within the Event Switch code.
If the amount is less than 5 I want to display an error message.
I have coded:
if ( $amount < 5 ) {
$form->validation_errors['Bedrag'] = "Foutief Bedrag";
return "fail";
}
The validation is executed correct because of the status 'fail' and the executing of the 'on fail' functions (Event Loop - Load), but the error message is not displayed.
I think the code $form->validation_errors['Bedrag'] = "Foutief Bedrag"; will not work in Chronoforms V5.
Helas I can't find another method.
Thanks for helping.
If the amount is less than 5 I want to display an error message.
I have coded:
if ( $amount < 5 ) {
$form->validation_errors['Bedrag'] = "Foutief Bedrag";
return "fail";
}
The validation is executed correct because of the status 'fail' and the executing of the 'on fail' functions (Event Loop - Load), but the error message is not displayed.
I think the code $form->validation_errors['Bedrag'] = "Foutief Bedrag"; will not work in Chronoforms V5.
Helas I can't find another method.
Thanks for helping.
Hi,
just read your post as I was interested🙂
Did you try "Display Message" in the "On fail" trigger?
There you can also access your $form->data values.
Best
Seagul
just read your post as I was interested🙂
Did you try "Display Message" in the "On fail" trigger?
There you can also access your $form->data values.
Best
Seagul
Thank you Seagul.
It works!
Sometimes you don't see the obvious solution.
In the meantime I found out an other soulution:
$app = \JFactory::getApplication();
$app->enqueueMessage('Foutief Bedrag. SVP minimaal 5 euro doneren.');
It works!
Sometimes you don't see the obvious solution.
In the meantime I found out an other soulution:
$app = \JFactory::getApplication();
$app->enqueueMessage('Foutief Bedrag. SVP minimaal 5 euro doneren.');
This topic is locked and no more replies can be posted.