Hi there,
(using modx 0.95 + patches & eform 1.4.4 from SVN)
I’m developing a form using eform which takes a couple of parameters from the URL. The previous help in this thread on that has helped me get those variables into the form and displaying in fields if I make them a text field. As soon as I make them hidden, I get errors telling me the rule failed. If I make them text fields (which makes them show up) then they post as you’d expect.
I’m calling the below function from the snippet which seems to work fine etc.
How do I treat hidden fields to become an element in the report / email to the recipient?
Many thanks!
Jamie
<?php
function GetPlaceHolder(&$fields){
$_SESSION['eform_title'] = $_REQUEST['title'];
$_SESSION['eform_axv_ref'] = $_REQUEST['ref'];
$fields['title'] = ( isset($_SESSION['eform_title']) )? $_SESSION['eform_title'] : "title failed";
$fields['axv_ref'] = ( isset($_SESSION['eform_axv_ref']) )? $_SESSION['eform_axv_ref'] : "ref failed";
unset($_SESSION['eform_title']); //clear for next time
unset($_SESSION['eform_axv_ref']); //clear for next time
return true;
}
// For the page 'outside' of the form - old code
$vacancy_name= (isset($_REQUEST['title']) ? $_REQUEST['title'] : "");
$vacancy_ref= (isset($_REQUEST['ref']) ? $_REQUEST['ref'] : "");
$modx->setPlaceholder('job_title',$vacancy_name);
$modx->setPlaceholder('job_ref',$vacancy_ref);
?>