Hi Klas,
Thanks for this solution (:- Thats a rather simple and effective way to manage this. Also efficient (less php-code).
Many thanks for hanging in here.
For the record my PHP-code below:
// DB-stuff - create query
$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select('tr_mail_aanmeld_header, tr_mail_aanmeld_body, tr_mail_aanmeld_footer');
$query->from($db->quoteName('#__cck_store_form_traject'));
$query->where($db->quoteName('tr_id')." = ". $fields['frm_tr_key']->value);
// DB-stuff - get the db-record into the $row
$db->setQuery($query);
$row = $db->loadObjectList();
// put values into variables to use below for replacement
$myVal_header = $row['0']->tr_mail_aanmeld_header;
$myVal_body = $row['0']->tr_mail_aanmeld_body;
$myVal_footer = $row['0']->tr_mail_aanmeld_footer;
// replace header-content
$fields['frm_mail_aanmeld_header']->value = $myVal_header;
$fields['frm_mail_aanmeld_header']->form = str_replace("##HEADER##",$myVal_header,$fields['frm_mail_aanmeld_header']->form);
// replace body-content
$fields['frm_mail_aanmeld_body']->value = $myVal_body;
$fields['frm_mail_aanmeld_body']->form = str_replace("##BODY##",$myVal_body,$fields['frm_mail_aanmeld_body']->form);
// replace footer-content
$fields['frm_mail_aanmeld_footer']->value = $myVal_footer;
$fields['frm_mail_aanmeld_footer']->form = str_replace("##FOOTER##",$myVal_footer,$fields['frm_mail_aanmeld_footer']->form);