Hello,
I have been experimenting with using phx to pre-populate the value= fields in eforms.
Just adding phx modifiers to the eform templates didn't work unsurprisingly:
<input type="text" value="[+phx:firstname+]" name="first name"/>
The value field ends up empty (the phx:firstname modifier is a custom snippet to get the persons name)
So I decided I would try running the phx parser against the template using eFormOnBeforeFormParse=`eFormPhx`:
function eFormPhx( &$fields, &$templates )
{
if(class_exists('PHxParser'))
{
$phxParser = new PHxParser();
global $modx;
$modx->logEvent("Eformphx",1,var_export($templates['tpl'],TRUE),"PreParse");
$templates['tpl'] = $phxParser->Parse($templates['tpl'] );
$modx->logEvent("Eformphx",1,var_export($templates['tpl'],TRUE),"PostParse");
}
return '';
};
I can see from the event log that the value fields are correctly populated. However, when the form is rendered, the value fields are empty.
Presumably eform is wiping the values because it doesn't expect to see them populated. Any ideas how I can do this?
Ultimately, what I am trying to do is pre-populate an eForm with normal user attributes and extended attributes from WebLoginPE.
Thanks,
Paul