Thanks guys, you saved my ass =)...had the same "Ditto in eForm tpl inputs (radios) not validating"-Problem and the hint with &eFormOnBeforeFormParse did it!
I also do the radio-input validation with #LIST so it looks like
<input type="radio" name="option" value="[+placeholderForDitto+]" class="radio" id="option[+placeholderForDitto+]" eform="Message::1:Has to be 1-5:#LIST 1,2,3,4,5" />
I totally have 5 of those inputs...
the reason I need Ditto is because the inputs should be placed in a random order =)...maybe a bit overkill but had no better idea
my snippet is slightly simpler because I just needed to call Ditto and insert the output at the right place, so I only have one function =):
<?php
if ( !function_exists('dittoCall') ) {
// This function will run ditto with the specified params on the eFormOnBeforeFormParse event
function dittoCall(&$fields, &$templates) {
global $modx; // Call $modx
//these line below creates an array call $params with the ditto parameters; $params['parents'] = 'id';
$params['parents'] = 'id';
$params['tpl'] = 'chunkName';
$params['randomize'] = '1';
//once the $params array is set, modx run snippet api is called for Ditto, with the above $params.
$output = $modx->runSnippet('Ditto', $params);
$templates['tpl'] = str_replace('[+placeholdername+]', $output, $templates['tpl']);
return '';
}
}
?>
PS: Sorry for bumping this old thread but it helped a lot...so it may help others!
[ed. note: last edited this post 12 years, 4 months ago.]