We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12652
    • 228 Posts
    Bingo!

    That worked.... marvelousousously! wink

    cheers
      | Identity Developments delivers SEO focused web design and web presence services
      - it's not about websites, it's about your identity. |
      • 23491 ☆ A M B ☆
      • 1,056 Posts
      Quote from: xwisdom at Nov 13, 2006, 06:52 PM

      Minor fix for eForm 1.4.1. If no ’validationmessage’ was set and the returned value is not equal to false then continue with sending email

      Line 334 should read:
                      elseif ($eFormOnBeforeMailSent($fields)===false) {
                          if( isset($fields['validationmessage']) && !empty($fields['validationmessage']) )
                              return formMerge($tpl,$fields);
      	                else 
      	                	return;
                      }


      Note the last "return" statement comes after the "else"

      @TobyL,

      Is the above fix valid and in place? Are we at 1.4.2 yet?
        Mike Reid - www.pixelchutes.com
        MODx Ambassador / Contributor
        [Module] MultiMedia Manager / [Module] SiteSearch / [Snippet] DocPassword / [Plugin] EditArea / We support FoxyCart
        ________________________________
        Where every pixel matters.
        • 30223
        • 1,010 Posts
        Not in my version yet,... will do this asap. And yes I’m just about ready with version 1.4.2 (which includes the small fixes made by xwisdom and some suggestion from sottwell)

        I’m in the middle of preparations for an art end of year student exhibition which opens next week, so I don’t sit behind the keyboard as much at the moment. I’ll see if I can get it done over the weekend.
          • 32963
          • 1,732 Posts
          I’m about half way into finishing up a project and I must say that eForm has saved me a lot of coding hours. It took away the need of having to validate my forms and made sending email reports a breeze smiley

          Many thanks to TobyL’s cool parser (I just can’t stop singing it’s praise) smiley It makes working with html forms a treat!



            xWisdom
            www.xwisdomhtml.com
            The fear of the Lord is the beginning of wisdom:
            MODx Co-Founder - Create and do more with less.
            • 7690
            • 166 Posts
            I love this eForm smiley
            Only the validation page is missing from the zip file? Cause i dont understand the validation explanation at the bottom of the index page.

            but i have 1 problem.
            If the email is sent, i recieve it. And if i want to reply to the mail, i have to click the link at the bottom of the mail.

            Is there a way to put this in the $mail->FromName = $modx->config[’site_name’];
            So i only have to click on the reply button in webmail.

            Cuz if i click on the link now, it will open Outlook...
              • 1371
              • 9 Posts
              I run a ModX 0.9.2.1 with eForm 1.4.1 installation.

              I have one problem that I can’t solve yet. After sending a form, if a user refreshes the "thank you" page it will resend the submitted data. Resulting in two or more emails sent to me. How can I prevent this from happenning?

              Thank you
                • 33337
                • 3,975 Posts

                I’m about half way into finishing up a project and I must say that eForm has saved me a lot of coding hours. It took away the need of having to validate my forms and made sending email reports a breeze smiley

                Many thanks to TobyL’s cool parser (I just can’t stop singing it’s praise) smiley It makes working with html forms a treat!

                I love to join xwisdom in the singing! laugh ... and for xwisdom too wink

                keep up guys!

                best wishes.

                zi
                  Zaigham R - MODX Professional | Skype | Email | Twitter

                  Digging the interwebs for #MODX gems and bringing it to you. modx.link
                  • 33337
                  • 3,975 Posts
                  Quote from: DNA at Nov 17, 2006, 12:58 PM

                  I love this eForm smiley
                  Only the validation page is missing from the zip file? Cause i dont understand the validation explanation at the bottom of the index page.

                  but i have 1 problem.
                  If the email is sent, i recieve it. And if i want to reply to the mail, i have to click the link at the bottom of the mail.

                  Is there a way to put this in the $mail->FromName = $modx->config[’site_name’];
                  So i only have to click on the reply button in webmail.

                  Cuz if i click on the link now, it will open Outlook...

                  You can use &replyTo parameter, for more information please check the documentation in eForm package.
                    Zaigham R - MODX Professional | Skype | Email | Twitter

                    Digging the interwebs for #MODX gems and bringing it to you. modx.link
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    If your field for getting the user’s email is called "email", you just put &replyTo=`email` in the snippet call. Or whatever the name of that field in the form is.
                      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
                      • 30223
                      • 1,010 Posts
                      Quote from: amirfl at Nov 17, 2006, 01:19 PM

                      I run a ModX 0.9.2.1 with eForm 1.4.1 installation.

                      I have one problem that I can’t solve yet. After sending a form, if a user refreshes the "thank you" page it will resend the submitted data. Resulting in two or more emails sent to me. How can I prevent this from happenning?

                      Thank you

                      You could use a session variable for that in combination with the eFormOnMailSent and eFormOnBeforeFormParse events. In the eFormOnMailSent (which is triggered when the form is succesfully submitted and after the email is sent - obviously) you could for instance set a session variable ’eformSubmitted’ to true. In the eformOnBeforeFormParse event you can then test for this session variable and when it is set to true, bail out early...

                      Place these 2 functions in a new snippet (eg: eFormFunctions)

                      <?php
                      function onMailSentFunction( &$fields){
                          $_SESSION['eformSubmitted']=true;
                          return true; //important!
                      }
                      
                      function onBeforeFormParseFunction( &$fields, &$templates  ){
                          if( isset($_SESSION['eformSubmitted']) && $_SESSION['eformSubmitted'] && count($_POST)>0 ){
                              //kill the fields array... which makes the submit fail and display the form
                              $fields = array();
                              //kill the form template and replace with a message which will be displayed since any validation will fail
                              $templates['tpl'] = "<p>You have already submitted the form succefully.</p>"
                          }
                          return true; //important!
                      }
                      ?>


                      In your document call both the new snippet and the eform snippet:

                      [[eformFunctions]]
                      [!eForm? &eFormOnBeforeFormParse=`onBeforeFormParseFunction` &eFormOnMailSent=`onMailSentFunction` ...more params... !]



                      This does have some drawbacks.. The user won’t be able to submit another form while teh same session is alive (even if (s)he fill in the from from scratch). You’d have to build in some mechanism to reset the session var again to allow them to do so.

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