I see another area where a fairly common situation will be troublesome. A select that is populated by a query (using a snippet) makes eForm very unhappy. I’m trying to figure out exactly what these extra server tags do; it’s possible one of them could be used to get the values from the database?
<?php
//some useless function
function beforeParseFunction(&$fields, &$templates){
$options = '<option value="1">One</option>\n<option value="2">Two</option>';
$templates['tpl'] = str_replace('[#myOptions#]',$options,$templates['tpl']);
return true;
}
?>
//..existing code eFormOnMailSent => isset($eFormOnMailSent)?$eFormOnMailSent:'', //add these eFormOnValidate => isset($eFormOnValidate)?$eFormOnValidate:'', eFormOnBeforeFormMerge => isset($eFormOnBeforeFormMerge)?$eFormOnBeforeFormMerge:'', eFormOnBeforeFormParse => isset($eFormOnBeforeFormParse)?$eFormOnBeforeFormParse:''

I’ll bet that this "before form parse" event can be used for adding custom validation functions, such as checking on the size of an uploaded image file. If it fails the validation, just put something unsuitable in the $fields array for it, and eForm will then fail it and send it back.
# [line 122/eForm.inc.php] Add an optional introduction chunk on initial page view
if (count($_POST) == '0') {
$intro = (($tmp = efLoadTemplate($intro)) !== false) ? $tmp : '';
echo $intro;
}
This discussion is closed to further replies. Keep calm and carry on.