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

    I am working on a mashup of WebLoginPE and eForm, which uses eForm as the contact form between users. The problem I am having is passing the username placeholder [+view.username+] to eform.

    I would like eform to parse <form method="post" action="[~[*id*]~]?service=viewprofile&username=[+view.username+]"> but it just discards the placeholder. When I put in the username as a static value, it works fine.

    I am sure that &eFormOnBeforeMailSent or something similar can be used, and I have been playing around with it a lot, but just can’t get it to work. What am I missing?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      The placeholder is merged into WebLoginPE, but not into eForm. You’ll need to grab it with $modx->getPlaceholder(’name’).
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 36571
        • 145 Posts
        OK, I have added the following to the eForm snippet:

        //Include WebLoginPE placeholders
        $username = $modx->getPlaceholder('view.username'),
        $useremail= $modx->getPlaceholder('view.email'),


        Although I am not sure if that is correct. Could you please elaborate sottwell?

        Thanks.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Not really, I’m not sure at what point those placeholders are set.
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 29525
            • 388 Posts
            I would also like to know if there is a way to populate the username and email address in the eform on my contact page.

            When a visitor has registered (using WebSignup) and later logs in using WebLogin, I’d like their information to populate the eform to send me a note.

            How would I do this?

            Thank you!
              www.terrybarthdesign.com
              • 36686
              • 165 Posts
              Was there any solution to this thred, how to pass vaiables from webloginPE to eform?

              I would like to do something similar - I’d like for a form created in webloginPE to be emailed to the administrator when filled in, and I’d like it to be populated with the user’s details.
                • 12684
                • 118 Posts
                I agree this would be very beneficial.
                  • 31533
                  • 8 Posts
                  In docs/eform_example_events.htm (included in eForm distribution) way to add new placeholder in $fields[] is descibed. Declare it is as reference:
                  //$fields as a reference
                  function someFunction( &$fields ){ ... }
                  

                  Note [tt]&[/tt]. It may help.