We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7455
    • 2,204 Posts

    I made 2 small snippets that lets you re-use all the form data that was insert in any eForm.

    The first snippet is used as a eForm event Snippet that saves all the eForm data into a SESSION.
    The second snippet needs to be called on the page where you like to use the eForm data

    first snippet needs to be called on the eForm page before the eForm call

    then you need to call the eForm like this (or simaler depets on what for you use but you need to use this event)
    [[eform2session]]
    [!eForm? &eFormOnBeforeMailSent=`eform2session` &formid=`form1_form` &noemail=`1` &tpl=`inquirer _form`  &gotoid=`66`!] 
    


    then on the pages that you need the placeholders place the second snippet like this to show all availible placeholders

    [[SESSION2Placeholders?&showplaceholders=`1`]]
    and like this without the placholder list:
    [[SESSION2Placeholders]]

    Snippet1:eForm2session
    <?php
    // eForm2session
    function eform2session(&$fields) {
    $_SESSION['naw'] = $fields;
    }
    return;
    ?>
    


    Snippet2:SESSION2Placeholders
    <?php
    if($_SESSION['naw']){
    foreach ($_SESSION['naw'] as $key => $value) {
    $modx->setPlaceholder($key, $value);
    if(isset($showplaceholders)){echo "the value [+".$key."+] is ".$value."<br />";}
    }
    }else{
    
    echo "No data in this session";
    }
    ?>
    
    


    To use this for more then one eform duplicate the snippet and change in both snipptes the values of $_SESSION[’naw’ (or change the snippet that it uses variables that can be set in the snippet call, that would be better)

    this part i did not test yet so if it does not work hash out this line:
    if(isset($showplaceholders)){echo "the value &#91;+".$key."+&#93; is ".$value."
    ";}

    Greets Dimmy and let me know if you like it.


      follow me on twitter: @dimmy01
      • 25663 MODX Staff
      • 12,272 Posts
      Dimmy that’s very cool. Thanks for sharing indeed.
        Ryan Thrash, MODX Co-Founder
        Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
        • 6726
        • 7,075 Posts
        Very cool indeed, having placeholders handy to handle session gathered data is just perfect grin
        Thanks Dimmy !
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l&#39;outil id
          • 19164
          • 1,215 Posts
          I think, that there will be work for text fields only and not for radio, checkbox and selectbox fields. You can’t to set they values only by setting of placeholders.
            DirectResize 0.9 beta. PHPThumb, sets of configurations, configuration, binded to specific path. No backward compatibility. | DirectResize 0.9. PHPThumb, наборы параметров, параметры, привязанные к определенным путям. Без обратной совместимости.

            Unfortunately, DirectResize project is closed. If you want to continue development, PM me for access to project page on Google Code. К сожалению, проект DirectResize закрыт. Если вы желаете продолжить разработки, обращайтесь через ПМ для получения доступа к репозиторию на Google Code.

            [PLUGIN] DirectResize - as Maxigallery but for single images :: Download :: [url=http://modxcms.com/forums/index.php/topic,21490]
            • 7455
            • 2,204 Posts
            well you could use PHx to see it tha placeholder has some valeu and returs checked="checked" e.g.
            the first form could be this:
            <input type="radio" value="thevalue" name="radioname" />
            

            then the placeholder wil be [+radioname+]

            and then the second form can be this
            <input type="radio" value="yes i like" name="aname" [+phx:if=`[+radioname+]`:is=`yes i like`:then=`checked="checked"`+] />
            


            Dimmy
              follow me on twitter: @dimmy01
              • 36699
              • 8 Posts
              Hi,

              Absolutely love this snippet - very handy.

              I’m using this for an e-commerce app where I’ve got a number of products (and attributes) numbered with [+ditto_iteration+]. Is it possible to output placeholders with the following format [+0:quantity+]? I can see the values in the SESSION output, just can’t seem to display the value.

              Any response very very much appreciated.
                • 7455
                • 2,204 Posts
                Quote from: uniqueIntention at Aug 18, 2009, 05:19 AM

                Hi,

                Absolutely love this snippet - very handy.

                I’m using this for an e-commerce app where I’ve got a number of products (and attributes) numbered with [+ditto_iteration+]. Is it possible to output placeholders with the following format [+0:quantity+]? I can see the values in the SESSION output, just can’t seem to display the value.

                Any response very very much appreciated.

                can you elaborate on that I do not realy understand what you are planning to do.
                you must understand that it wil just grab the values from the sesion and the coresponding key as placeholder -> value
                than you can place the placeholder where you want. and you can use phx on it.

                Dimmy
                  follow me on twitter: @dimmy01