Hello,
In order to only show not empty fields in an 'On Submit-email', I tried to use the solution from this topic (https://www.chronoengine.com/forums/posts/f5/t20430.html?page=1), but it doesn't seem to work.
In the OnSubmit action, I added this Custom Code, just before the Email action:
In the Email action I refer to this code with {formulier}, but it shows nothing, except for the other emailtext. What am I doing wrong?
Thanks in advance!
Henk
In order to only show not empty fields in an 'On Submit-email', I tried to use the solution from this topic (https://www.chronoengine.com/forums/posts/f5/t20430.html?page=1), but it doesn't seem to work.
In the OnSubmit action, I added this Custom Code, just before the Email action:
<?php
$input_array = array(
'name' => 'Naam',
'email' => 'E-mailadres',
'telefoonnummer' => 'Telefoonnummer',
'adres' => 'Adres',
'uitvaart' => 'Soort uitvaart'
);
$formulier = array();
foreach ( $input_array as $k => $v ) {
$temp = JRequest::getVar($k, '', 'post');
if ( $temp ) {
$formulier[] = "$v : $temp";
}
}
JRequest::setVar('formulier', implode('<br />', $formulier));
?>
In the Email action I refer to this code with {formulier}, but it shows nothing, except for the other emailtext. What am I doing wrong?
Thanks in advance!
Henk
Hi Henk,
Please make sure that the editor is disabled in the Email Template box and use this code as an example:
Regards,
Max
Please make sure that the editor is disabled in the Email Template box and use this code as an example:
<?php if(!empty($form->data["field_name"])): ?>
{field_name}
<?php endif; ?>
Regards,
Max
This topic is locked and no more replies can be posted.
