I have been able to use this succesfully in the past (from a validation procedure)

The 'just testing' message comes from a custom code control.
Ways round it but it was working.
Nick
if (!isset($thisData['conveners'])) {Now the text appears on return to my form but this is the result
$isDataValid = 'NO';
?>
{error:You must include at least one convener}
<?php
} else {

The 'just testing' message comes from a custom code control.
Ways round it but it was working.
Nick
if(empty($this->data("fieldname"))
And this is in a Custom Code block, right?
And this is in a Custom Code block, right?
isset seems to detect the error but empty makes more sense.
function is called from a php logic block so:

Nick
function is called from a php logic block so:

Nick
Yes but the block you're having trouble with, is it in a PHP block or a Custom Code block?
Also you can just do it like this
https://docs.joomla.org/Display_error_messages_and_notices
Also you can just do it like this
JFactory::getApplication()->enqueueMessage("Message", "type");
https://docs.joomla.org/Display_error_messages_and_notices
a php block. I will swap to a custom code block shortly and try that first. I can use the PHP approach if not.
Nick
Nick
Using a custom code block partially fixed it.
The enqueueMessage method works though the message appears in the PHP form rather than the chronoforms orm.
Nick
.
<?phpThe messages appeared correctly but while validateCourseDataValues is set within the php code {var:validateCourseDataValues} is not available outside that custom code. I could not use the return values in a event switch.
$this->set('validateCourseDataValues',validateCourseDataValuesV6($this->data,$this->get('read_data1.mdlTermInfo')));
?>
The enqueueMessage method works though the message appears in the PHP form rather than the chronoforms orm.
Nick
.
This topic is locked and no more replies can be posted.