Anybody here knows why vericode field is self populating when using eForm parser by TobyL ?Yes I do ...
I’ve only just installed the eForm snippet but I think I’ve found the problem.function buildTagPlaceholder($tag,$attributes,$name){
$type = stripTagQuotes($attributes["type"]);
$quotedValue = $attributes['value'];
$val = stripTagQuotes($quotedValue);
foreach ($attributes as $k => $v)
$t .= ($k!='value' && $k!='checked' && $k!='selected')?" $k=$v":"";
switch($tag){
case "select":
return "<$tag$t>"; //only the start tag mind you
break;
case "option":
return "<$tag$t value=".$quotedValue."[+$name:$val+]/>";
break;
case "input":
switch($type){
case 'radio':
break;
case 'checkbox':
return "<input$t value=".$quotedValue."[+$name:$val+]/>";
break;
case 'text':
break;
case 'password':
return "<input$t value=\"[+$name+]\"/>";
break;
default: //leave as is - no placeholder
return "<input$t value=".$quotedValue."/>";
break;
}
case "textarea": //placeholder needs to be added in calling code
return "<$tag$t>";
break;
default:
return "<input$t value=\"[+$name+]\"/>";
break;
} // switch
return ""; //if we've arrived here we're in trouble
}[!eForm? &formid=`TellAFriend` &sendirect=`1` &to=`[+email+]` &ccsender=`1` &tpl=`TellAFriend` &report=`TellAFriend-report` &subject=`[+fromname+] wants you to see this site` &from=`[+from+]` &fromname=`[+fromname+]`!]
<form name="tell" id="tell" method="post" action="[~[*id*]~]"/> <input type="hidden" name="formid" value="TellAFriend"/> <input type="hidden" name="email" value="[+email+]"/> <fieldset> <h3>The Message</h3> <label for="fromname">Your Name: <input type="text" name="fromname" id="fromname" size="20" value="[+fromname+]" eform="Your name:String:1" /> </label> <label for="from">Your Email: <input type="text" name="from" id="from" size="20" value="[+from+]" eform="Your email address:Email:1" /> </label>
From: [+from+]@vertexworks.com Subject: Ryan Thrash wants you to see this site

I’ve had a quick look over the eFormParser.inc.php and noticed in the buildTagPlaceholder() function, the switch ... case statement is missing all-important break statements at the end of each case. Now, this affects the way in which the switch ... case statement functions and how, in this case, the input fields are handled.
Anybody here knows why vericode field is self populating when using eForm parser by TobyL ?
<?php
//existing code
$tagAttributes = attr2array($fieldTags[$i]);
//attribute values are stored including quotes
//this avoids problems with embedded quotes
//strip quotes as well as any brackets to get the raw name
$name = str_replace(array("'",'"','[',']'),'',$tagAttributes['name']);
//added line below
//exception for vericode field
if($name=="vericode") continue;
?>
Perhaps I’m a sloppy and lazy programmer leaving the break statements out but they are not really needed here. Since each case statement ends with a return the break statement is never executed anyway.Not at all ... my bad for not initially understanding what the code was doing (too many coffees and late nights for me, lol).

While we’re on the subject of fixing eForm oddities, how can we take an email address and name entered in the form and make it into the sender address/name...I tried this out and added in the following lines at line 205 in the eform.inc.php and it appears to do the trick:
$from = formMerge($from,$fields); $fromname = formMerge($fromname,$fields);
I believe $report should be replaced by $autotext.
Encountered this tiny bug in multiple versions, don’t know whether it still exists in the latest version or not.
PS.
eForm is a great snippet, keep up the good work!
# load autotext template
if (strlen($autotext)<50) {
if(is_numeric($autotext)) $autotext = ($doc=$modx->getDocument($autotext)) ? $doc['content']:"Document id '$autotext' not found.";
else if($autotext) $report = ($chunk=$modx->getChunk($autotext)) ? $chunk:"Chunk '$report' not found.";
}I believe $report should be replaced by $autotext.
Encountered this tiny bug in multiple versions, don’t know whether it still exists in the latest version or not.
# load autotext template
if (strlen($autotext)<50) {
if(is_numeric($autotext)) $autotext = ($doc=$etomite->getDocument($autotext)) ? $doc['content']:"Document id '$autotext' not found.";
else if($autotext) $report = ($chunk=$etomite->getChunk($autotext)) ? $chunk:"Chunk '$report' not found."; // <== OVER HERE
}
# load report template
$report_tpl_id = $report;
if (strlen($report)<50) {
if(is_numeric($report)) $report = ($doc=$etomite->getDocument($report)) ? $doc['content']:"Document id '$report' not found.";
else if($report) $report = ($chunk=$etomite->getChunk($report)) ? $chunk:"Chunk '$report' not found.";
}
No shame, I fall for this one every time 
This discussion is closed to further replies. Keep calm and carry on.