[Solved] Custom error with no particular field

WhiteLighter01 07 Sep, 2013
Hi all,

I have been working on a couple of Chronoforms with different validations and stuff. Recently, I need to modify an existing form to do add a different requirement. What I'm trying to do is check all fields, and depending on the combinations of selections, I'll need to show an error message. I know that I can use the code below to show an error message specific to a field under custom server validation
$form->validation_errors['age'] = "You should be 18 and above to participate.";
return false;

But what if I would like to have a global error message on the form that is not field specific? Is it possible to have something like a custom joomla notice/warning message on the form?

Joomla 2.5.14
Chronoform v4 RC3.0
GreyHead 07 Sep, 2013
Hi WhiteLighter01,

If your template supports Joomla! system messages then you could use that instead:
$app =& JFactory::getApplication();
$app->enqueuemessage('You should be 18 and above to participate.', 'error');
return false;

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