We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30223
    • 1,010 Posts
    Updated the repository with the final 1.4 version. See top post for changes
      • 16885
      • 255 Posts
      The snippit .tpl still contains <?php ?> which generates a parse error when it’s copied to the snippit in MODx, you might want to remove that one wink

      I was hoping this release would also fix my trouble, but I guess it’s rather a MODx problem than eForm.
        • 23491 ☆ A M B ☆
        • 1,056 Posts
        Quote from: TobyL at Oct 18, 2006, 12:31 AM

        Updated the repository with the final 1.4 version. See top post for changes

        Thanks, Toby! What do you know? I’m getting my form to show up and process!

        NOTE: /docs/eform.html still titled eForm 1.3 - Electronic Form Snippet (Extended)
          Mike Reid - www.pixelchutes.com
          MODx Ambassador / Contributor
          [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
          ________________________________
          Where every pixel matters.
          • 23491 ☆ A M B ☆
          • 1,056 Posts
          Quote from: pixelchutes at Oct 18, 2006, 12:50 PM

          Thanks, Toby! What do you know? I’m getting my form to show up and process!

          OK!

          So now my form shows up, properly parses eform pseudo-attributes, error-checks, and successfully emails.

          NOTE:
          Per the updated eForm, my Chunk does not contain any placeholders (e.g. [+email+])

          1. If I submit an incomplete form, the values to be stored within their respective elements are coming through as "/" ... huh

          So, even if I enter a value of, say, ’12345’ for my Name, it comes through as / instead of my name... however, if I submit a complete form (valid email, etc.) the proper values are being sent in the email.

          e.g.
          <input name="first_name" id="first_name" size="30" title="Please enter your first name." value=/>
          


          2. ALSO: Pre-selected select menus don’t have proper spacing for generated HTML:

          ...
          <option value="United States"selected='selected'/>United States</option>
          ...
          


          3. Redirecting - I am using &thankyou to display a chunk containing message summary. While the form’s actionis pointing to the proper page/URL, the page loaded AFTER ANY submission is my default starting page? I am using FURLs...

          Anyone who has a clue as to why submitting the form takes me to my home page, please share!
          Update: If I change my form method from POST to GET, the destination page is the same. I have the same form on every single page, so it is easy to catch when I’ve submitted on page X and end up on page Y. Of course, eForm appears to have been written with $_POST in mind, making GET out of the question. Plus, I’d prefer POST.
            Mike Reid - www.pixelchutes.com
            MODx Ambassador / Contributor
            [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
            ________________________________
            Where every pixel matters.
            • 6425
            • 23 Posts
            I am getting this error when using the form.

            Parse error: parse error in /var/www/WEVmodX/modx-0.9.2.1/manager/includes/document.parser.class.inc.php(705) : eval()’d code on line 1

            I used the same two chunks that I am using on another site (its using version 1.3 on does not use FURLS), but on my other site using version 1.4 and using FURLS, I get the above error.
              • 23491 ☆ A M B ☆
              • 1,056 Posts
              4. Blank Page - When using &eFormOnBeforeMailSent (as defined in the docs), I get a blank page (no output) when submitting the form.

              Update: It appears that this is closely related to my snippet inclusion for my defined callback-function.


              Snippet: eFormCallback
              <?php
              function testing(&$fields)
              {
              $fields[from]='[email protected]';
              return;
              }
              ?>
              


              So, before my [! eForm? ... !] I place [[eFormCallback]] so that the callback function is present for eForm...but all I get is a white-empty page on form submit.

              UPDATE:

              Well, I re-read the docs, and I noticed I wasn’t do things exactly as shown:

              1. I need to return a true or false value within my callback function

              2. I should return an empty string at the end of the snippet.
              I believe that I was inadvertently causing the a premature-end of the request with my ’misformatted’ snippet...

              CORRECT EXAMPLE: (Works!)

              <?php
              function form2db( &$fields ){
              	//rest of function code as above
              $fields[first_name]='ted';
              return true;
              }
              //return empty string
              return '';
              ?>
              


              @danderson,

              What version/revision of MODx are you using? looks like v0.9.2.1 ...

              UPDATE:

              Quote from: pixelchutes at Oct 18, 2006, 01:15 PM

              Per the updated eForm, my Chunk does not contain any placeholders (e.g. [+email+])

              1. If I submit an incomplete form, the values to be stored within their respective elements are coming through as "/" ... huh

              So, even if I enter a value of, say, ’12345’ for my Name, it comes through as / instead of my name... however, if I submit a complete form (valid email, etc.) the proper values are being sent in the email.

              e.g.
              <input name="first_name" id="first_name" size="30" title="Please enter your first name." value=/>
              


              If I manually place the [+placeholders+] this is not an issue ...might want to validate auto-placeholder logic?

                Mike Reid - www.pixelchutes.com
                MODx Ambassador / Contributor
                [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                ________________________________
                Where every pixel matters.
                • 6425
                • 23 Posts
                My problem is solved - I had left

                <?php
                ?>

                in the snippet instead of taking them out.
                  • 23491 ☆ A M B ☆
                  • 1,056 Posts
                  Quote from: danderson at Oct 18, 2006, 05:44 PM

                  My problem is solved - I had left

                  <?php
                  ?>

                  in the snippet instead of taking them out.

                  Good catch.

                  As for this redirect bug....very weird!

                  In the eForm snippet the gotoid is, if not defined, defaulted to the $modx->documentIdentifier

                    gid         => isset($gotoid)? $gotoid:$modx->documentIdentifier,
                    ...
                  


                  However, when I turn on debug, this value is coming through as ’1’, even when I don’t define it.
                  also, if I define &gotoid=5 (my test page), the resulting page ends up on id=5, but not "incomplete submissions" ... !! In other words, if I submit a blank form, I’m taken to my home page with all of the form errors... sad
                    Mike Reid - www.pixelchutes.com
                    MODx Ambassador / Contributor
                    [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
                    ________________________________
                    Where every pixel matters.
                    • 25663 MODX Staff
                    • 12,272 Posts
                    Another fun challenge today... I’m trying to set the default values of some fields in an eform to a logged in webuser’s profile details. I can’t get it to work at all. For example, I tried to set it to the logged in users name via PHx:

                    value="[+phx:userinfo=`username`+]"


                    and by using [[GetUserName]]:

                    $pid = $modx->getLoginUserID();
                    $data = $modx->getUserInfo($pid);
                    
                    return $data['fullname'];


                    with the following field:

                    value="[[GetUserName]]"


                    Ideas ... or is it just a wonky bug I’ve run into?
                      Ryan Thrash, MODX Co-Founder
                      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                      • 4195
                      • 398 Posts
                      Just a wild guess is that MODx tags IN form tags will not get parsed because eForm parses the template before MODx can get to it.
                        Armand Pondman
                        MODx Coding Team
                        :: Jot :: PHx

                      This discussion is closed to further replies. Keep calm and carry on.