if ($mselector && $fields[$mselector]) {
$i = (int)$fields[$mselector];
$ar = explode(",",$to);
if ($i>0) $i--;
if ($ar[$i]) $to = $ar[$i];
else $to = $ar[0];
//check subject selector
if($sselector){
$sar = explode(",",$sselector);
if ($sar[$i]){
/*replace subject only if valid*/
$subject = $sar[$i];
$fields['subject'] = $subject;
}
}
}[!eForm? &formid=`ContactForm` &tpl=`ContactForm` &fromname=`[+Name+]` &from=`[+email+]` &to=`[email protected]` &report=`ContactReport` &gotoid=`7` &vericode=`1` &subject=`Contact Form Submission From [(site_name)] WebSite`!]
[!eForm? &formid=`ContactForm` &tpl=`ContactForm` &fromname=`[+Name+]` &from=`[email protected]` &replyto=`[+email+]` &to=`[email protected]` &report=`ContactReport` &gotoid=`7` &vericode=`1` &subject=`Contact Form Submission From [(site_name)] WebSite`!]
[!Wayfinder? &startId=`[+courses+]` &textOfLinks=`pagetitle` &outerTpl=`eFormOuterTpl` &rowTpl=`eFormRowTpl`!]
<?php
//ListOfCourses() converts tv courses (presented as Delimited List) to html chunk with list of courses with actual names
function ListOfCourses(&$fields){
$fields['coursesList'] = implode(',',$fields['courses']);
$fields['coursesList'] = $modx->runSnippet(
"Wayfinder",
array(
"startId" => "415",
"includeDocs" => $fields['coursesList'],
"textOfLinks" => "pagetitle",
"outerTpl" => "eFormThanksOuterTpl",
"rowTpl" => "eFormThanksRowTpl"
)
);
return true; //else eForm will just stop
}
$formTop = $modx->getChunk("eRegisterFormTop");
$dittoOutput = $modx->runSnippet(
"Ditto",
array(
"parents" => "415",
"depth" => "1",
"tpl" => "dittoCoursesListForEForm",
"display" => "all",
"orderBy" => "PriceNumber",
"filter" => "hidemenu,0"
)
);
$formBottom = $modx->getChunk("eRegisterFormBottom");
return($formTop.$dittoOutput.$formBottom);
?>
Sorry about that; I couldn’t recall what the parameter was, and was in a hurry, and figured to at least give the reply that it is possible and there’s a parameter to do it.or any value you like.&invalidClass=`invalidValue`
<p><label for="fname">First Name <span class="invalid">Please input your first name.</span> </label> <input type="text" name="fname" id="fname" eform="First Name:string:1" tabindex="3" /> </p>
eForm 1.4.4This discussion is closed to further replies. Keep calm and carry on.