We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22827
    • 129 Posts
    I am using phx now - I cannot be certain that I didn’t have it installed and bound to the events it needs, but I am pretty sure I didn’t.

    But lets say I did - I wasn’t using any phx extensions, so what were you thinking - could phx remove a place holder before eform got to it?
      • 7455
      • 2,204 Posts
      Quote from: paulkoan at Mar 18, 2009, 09:30 AM

      I am using phx now - I cannot be certain that I didn’t have it installed and bound to the events it needs, but I am pretty sure I didn’t.

      But lets say I did - I wasn’t using any phx extensions, so what were you thinking - could phx remove a place holder before eform got to it?


      Yes that is exactly what happents try disabling phx for testing.
      see if it works then
      if it does then try returning the placeholder in a chunk of even a snippet that returns the placeholder to fool phx
        follow me on twitter: @dimmy01
        • 40045
        • 534 Posts
        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.]