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
    This is an auto-generated support/comment thread for eForm.

    Use this forum to post any comments about this addition or any questions you have regarding its use.

    Brief Description:
    A very flexible and extendable form parsing snippet that will let you create web forms which can be sent via email to recipients you specify or can be used to process form values whichever way you like via it’s comprehensive event structure.

    --
    Moderator-Added Help:

    Quote from: TobyL at Sep 28, 2006, 07:47 PM

    This is an updated version incorporating eForm and eFormParser into one file and which includes some enhancements:

    • Powerful form validation using custom validation rules.
    • A thank you template so you can add form values to the response page
    • Language support - all eForm message are now stored in a language file so you can easily adapt it to your own language (or the language of your users
    • Some minor tweaks, notably a change in the validation messages
    • Fixes to a few bugs that nobody had noticed yet smiley

    18 October 2006: Repository UPDATED to version 1.4
    Changes in 1.4:

    • New: Extra parameter &sessionVars to add session variables to the field values
    • New: Extra parameters &sendAsHtml and &sendAsText - force email messages to be in Html or text only format.
    • Fixed: &debug parameter wasn’t doing anything
    • Fixed: changed erroneous &isDebug to correct &debug parameter in documentation
    • Fixed: Returning ’foreach’ error when chunk or document not found for form template
    • Fixed: Erroneous error when using multiple forms on a page ($formats persisted between eForm calls)
    • Updated: Events now work using the &eFormOnBeforeMailSent and &eFormOnMailSent paramaters.
    • Updated: [+subject+] can now be used in report and thank you templates
    • Updated: When using a document for the templates the document no longer needs to have published set
    • New: Show error if &tpl is set to the same document (id) containing the eForm snippet call
    • New: extended debug messages for validated fields (if &debug is set)
    • New: added some protection against mail injection
    • New: &reportAbuse parameter - send ’abuse alert’ mail to [(mailsender)] if mail injection is noticed
    • New: You can now use <form id="formName"...> to match your &formid=`formName` instead of <input type="hidden" name="formid" value="formName" />
    • New: You can now set the description using the label tag instead of in the eform attribute
    • New: Added &disclaimer parameter for adding a disclaimer to the email body.
    • Optimized: moved form parser code so it is only executed when form is posted
    • Updated: You can again use placeholders in &from and &fromname (as you can with &subject and &keywords)

    • Updated: It is now possible to use special placeholders in #SELECT validation rule
    • New: you can now use the #LIST validation rule for file type checking with file uploads
    • New Example: How to use eform events
    • New Example: Multiple forms on one page


    11 December 2006 - Updated to version 1.4.2

    • New: validation message placeholder no longer requires wrapping elements - You should now just use [+validationmessage+]
      instead of <div clas="error">[+validationmessage+]</div> (or similar)
      You can use the $_lang[’ef_validation_message’] in your eform language file to format
      the message. Add [+ef_wrapper+] to this variable where you want the messages to appear
    • New: You can now place the anywhere in your document (outside the form template)
    • New: Support for in-line validation alert via the new &requiredClass and &invalidClass parameters
    • New: Email character set now follows the modx setting (thanks to Gildas)
    • Update: Tweaked the sessionVars parameter so it’s no longer sensitive to spaces in comma seperated values
    • Update: Changed the date validation due to php version differences (Raymond Irving)
    • New: &css parameter - Adds css to the head of the document when the form is displayed
    • New: &jscript parameter - Adds javascript to the head of the document when form is displayed
    • New: eForm now checks for version differences between snippet and eform.inc.php
    • New: &protectSubmit parameter - protect against multiple submits of similar form data
      values: 0=off, 1=use required fields, or comma separated list of fields to compare
    • New: &submitLimit parameter - Time limit in minutes on successive submits of same form
    • works standalone or in combination with &protectSubmit - see documentation for details

    8 January 2007 - Updated to version 1.4.3
    This version is a bug fix release, no new functionality was added. Two bugs were discovered which showed up when using multiple forms on the same page.

    • FIXED: When using multiple forms on a page all forms are parsed and validated even when only one form is submitted.
    • FIXED: fields array values were not cleared between forms (resulting in setting validation messages in all forms when any of the forms form doesn’t validate)
    Many issues were discussed in the old thread [Snippet] eForm - The Electronic form Snippet.
      • 31654
      • 238 Posts
      Quick question about 1.3 (sorry if it’s in the wrong place) [Mod: It was, now it isn’t]

      Will the dynamic "From" work now?
      Meaning, can I use the email address the user enters in the form as the "from" address when the email is sent?

        Web Development, Web Hosting & Search Engine Marketing by:

        Vitalized | UK
        w. www.vitalized.co.uk

        Website Design | Search Engine Marketing (SEM) | UK MODx web hosting, secure, fast & 100% MODx compatible

        Vitalized | Australia
        w. www.vitalized-australia.com.au

        Website Design | Search Engine Marketing (SEM) | Australian MODx web hosting, secure, fast & 100% MODx compatible
        • 30223
        • 1,010 Posts
        The from address will either be as you set it with the &from parameter (as in &from=`[email protected]`) or will default to the email address you have set in the MODx configuration.

        However you can set the &replyto parameter to a fieldname (for instance &replyto=`email`) This would set the ReplyTo email header to the email address the user filled in in the email field. Hopefully this is useful to you.

        I would be very hesitant to make the same functionality for the from field as it would mean that you could (with the ’right’ combination of parameters) create a form where people can send an email purporting to come from someone else to anyone they like. I wouldn’t feel comfortable with that.

          • 13284
          • 95 Posts
          Hello everyone I’m currently trying to get this to work and for some reason I’m at a lost. Please note I’m really a big newbie to CMSes, snippets, CSS, etc so please make your responds for someone who has no clue ^_^ thanks.

          *snippet*: http://www.modxcms.com/eForm-1003.html

          Current page that displays the eform code: http://www.tapanime.com/cms/pageinfo/contact.php

          First off I don’t know why the form goes off the page? mostly like a html/css coding problem.

          I’ve tried to send an email and it doesn’t go to the thank you page or send the email or anything. Here is the code behind the pages:

          eFeedBackForm (I did change the [*id*] to 18 which is my contact.php still didn’t work so changed it back??)
          <p><span style="color:#900;">[+validationmessage+]</span></p>
          <form method="post" action="[~[*id*]~]">
              <input type="hidden" name="formid" value="feedbackForm" />
              <p><label accesskey="n" for="Name">Your Name</label>
              <input type="text" name="Name" maxlength="60" eform="Your Name::1:Expected at least two words:#REGEX /\w+\b\w{2,}/i" /></p>
          
              <p><label accesskey="e" for="email">Your Email Address</label>
              <input type="text" name="email" size="40" maxlength="40" eform="Your Email Address:email:1" /></p>
              
              <p><label accesskey="c" for="comments">Comments</label>
              <textarea cols="40" rows="10" name="comments" eform="Comments:html:1"></textarea></p>
          
              <p>
              Please enter the anti spam code below:<br />
              <img src="[+verimageurl+]" alt="verification code" border="1"/>
              </p>
              <p>
              <label accesskey="c" for="vericode">code</label>
              <input type="text" name="vericode" size="20" />
              </p>
              
              <p><input type="submit" name="submit" value="Send Feedback"></p>
          </form>
          


          eFeedBackThanks:
          <h3>Thank you for your feedback</h3>
          <p>We know how you appreciate our ongoing efforts and thank you for your praise.
          We will take any suggestions you may have made to heart and will endeavor to
          respond to you in a timely manner.  However as all office staff is attending
          our 4 week annual company retreat, this year held in the Costa Del Sol, we ask
          for your patience.</p>
          <p>Below is a copy of your message:</p>
          <table>
          <tr><td>Your name:</td><td>[+Name+]</td></tr>
          <tr><td>Your email address</td><td>[+email+]</td></tr>
          <tr valign="top"><td>Your comments</td><td>[+comments+]</td></tr>
          </table>


          eFeedbackReport:
          <p>This is a response sent by [+Name+] using the feedback form on the website. The details of the message follow below:</p>
          <table>
          <tr valign="top"><td>Name:</td><td>[+Name+]</td></tr>
          <tr valign="top"><td>Email:</td><td>[+email+]</td></tr>
          <tr valign="top"><td>comments:</td><td>[+comments+]</td></tr>
          </table>
          <p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE:[+subject+]">[+email+]</a></p>
          


          contact page call:
          [[eForm? &formid=`feedbackForm`
          &to=`[email protected]`
          &tpl=`eFeedBackForm` &report=`eFeedbackReport`
          &thankyou=`eFeedbackThanks` 
          &vericode=`1` &subject="Web site feedback"]]


          Any thoughts on what I’m doing wrong and how to get it to work? Also when I first installed the pages and snippet I got an error it was looking for the php in a snippet Dir called eformx instead of eform so I made a eformx folder and uploaded the contents in there and it started working.

          Thanks for any help.
            • 32963
            • 1,732 Posts
            Hi Izumi ,

            Make sure that your page is not cached or that the snippet is called in non-cached mode [!eFrom!]

            Also correct the &subject="" param to &subject=``

              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 13284
              • 95 Posts
              Hey xwisdom,

              Thanks that seemed to work for the most part, now the next question ^_^

              I get this msg when I tried to send a test email:

              Some errors were detected in your form:
              Your Name » Expected at least two words

              Now I put my name in there and it still gives me that, what does that mean excatly and how do I turn it off where they would need a first and last name or 2 words for a name?

              Thanks again
                • 22815
                • 1,097 Posts
                Change
                eform="Your Name::1:Expected at least two words:#REGEX /\w+\b\w{2,}/i"
                to
                eform="Your Name::1"
                  No, I don&#39;t know what OpenGeek&#39;s saying half the time either.
                  MODx Documentation: The Wiki | My Wiki contributions | Main MODx Documentation
                  Forum: Where to post threads about add-ons | Forum Rules
                  Like MODx? donate (and/or share your resources)
                  Like me? See my Amazon wishlist
                  MODx "Most Promising CMS" - so appropriate!
                  • 13284
                  • 95 Posts
                  Awesome you guys are fantasic.

                  If it isn’t tooooo much more trouble or a pain could you maybe answer 2 more tweaking questions?

                  1.) Is there a way to add a Pull down menu option for the subject and have that posted as the subject in the email? Kind website feedback, Feature request, etc as a subject?

                  2.) Is there a way to get the result email sent showing the person’s name and email address as the sender instead of the CMSs registered email address? Also in the email I get the subject just has the RE: but no subject in the body of the email it’s looking for a <code>[+subject+]</code> ?

                  Thanks a bunch everyone.
                    • 4707
                    • 73 Posts
                    I’ve upgraded to version 1.3. Great snippet!

                    All went smooth except for some things:

                    * The installation instructions mention that the snippet should be inside a folder called eform. But the snippet seems to like to be in a folder called eformx, or else it will throw some errors.

                    * A little bug in the option html tag preventing the page from validating as xhtml (see this post: http://modxcms.com/forums/index.php/topic,2122.msg50823.html#msg50823)

                    * It seems that the [+name] and [+email+] placeholders can’t be used in the snippet call anymore? When I call the snipped this way:
                    [!eForm? &formid=`emailContactForm` &fromname=`[+name+]` &from=`[+email+]` &to=`[(emailsender)]` &subject=`[+subject+]` &tpl=`EmailForm` &report=`EmailReport` &thankyou=`EmailSent` &vericode=`1`!]
                    and after using the form, the email sent has "From" field set to "[+name+] <[+email+]>". The "Subject" field is set correctly though (it’s not set to "[+subject+]").
                      • 30223
                      • 1,010 Posts
                      The installation instructions mention that the snippet should be inside a folder called eform. But the snippet seems to like to be in a folder called eformx, or else it will throw some errors

                      Oops,.. my mistake. I temporarily placed eform locally in the eformx folder while I was working on it, missed upating that one very impoirtant reference sad I’ve updated the repository so it has the correct path

                      It seems that the [+name] and [+email+] placeholders can’t be used in the snippet call anymore? When I call the snipped this way:
                      Code:

                      [!eForm? &formid=`emailContactForm` &fromname=`[+name+]` &from=`[+email+]` &to=`[(emailsender)]` &subject=`[+subject+]` &tpl=`EmailForm` &report=`EmailReport` &thankyou=`EmailSent` &vericode=`1`!]

                      and after using the form, the email sent has "From" field set to "[+name+] <[+email+]>". The "Subject" field is set correctly though (it’s not set to "[+subject+]").

                      The placeholders are ’targets’ for eForm to fill with data, while the snippet call is a source to supply eFrom with data. I don’t know if you ever could use these placeholders in the snippet call.. Where would eForm get the data from? The eForm placeholders are used in the report, autotext and report template and (generated by the form parser) in the form template.

                      &from needs one or more regular email addresses, while &fromname expects a real name. You can leave them empty in which case they will be filled with the ’email sender’ and the ’site name’ as set in the MODx configuration.

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