We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29655
    • 16 Posts
    I’m kind of stuck trying to enable the file upload/attachment to work with eForm 1.4. The form itself works fine and all the values entered are returned except the attached file. Here’s what I got in the template:

    <input type="file" name="picture1" eform="Picture 1:file:0" />


    and in the report template:
    	<td>[+picture1+]</td>


    Can anybody let me know what I’m doing wrong? Thanks in advance
      • 30223
      • 1,010 Posts
      Did you set the enctype of the form to multipart/form-data ?

      <form method="post" action="[~[*id*]~]" enctype="multipart/form-data">
        • 29655
        • 16 Posts
        Gah. Now I look silly.

        Thanks TobyL (again). smiley
          • 16429
          • 254 Posts
          Italian language for eForm 1.4.1
            kudo
            www.kudolink.com - webdesign (surprised?)

            [img]http://www.kudolink.com/kudolinkcom.png[/img] [sup]proudly uses[/sup] [img]http://www.kudolink.com/modx.png[/img]
            • 32963
            • 1,732 Posts
            Here’s a small fix to validating date/time in eForm 1.4.1

            File eform.inc.php Line 210:
            $rt = strtotime($value); //php 5.1.0+ returns false while < 5.1.0 returns -1
            if ($rt===false||$rt===-1) $vMsg[count($vMsg)]=$desc . $_lang["ef_invalid_date"];
            


            Version 1.4.1 is really great! Keep up the good work TobyL.
              xWisdom
              www.xwisdomhtml.com
              The fear of the Lord is the beginning of wisdom:
              MODx Co-Founder - Create and do more with less.
              • 25663 MODX Staff
              • 12,272 Posts
              Thanks Raymond ... committing as 1945...
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 30223
                • 1,010 Posts
                Thanks indeed. I’l update the file in the resources repository..
                  • 32963
                  • 1,732 Posts
                  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"
                    xWisdom
                    www.xwisdomhtml.com
                    The fear of the Lord is the beginning of wisdom:
                    MODx Co-Founder - Create and do more with less.
                    • 12652
                    • 228 Posts
                    My test hasn’t worked, so I’m guessing that it isn’t possible, currently anyway, but I haven’t seen any other messages regarding this... or missed them....

                    I would like to be able to mix text and placeholders in the subject for the email, that way I can give the form submitter the opportunity to add their own subject information while also including some common text that could be used for filtering in an email client or at least help identify real emails versus spam.

                    &subject=`Contact from mywebsite.com - [.subject.]`


                    The [.subject.] part gets pulled from the form submission and included, but not the "Contact from mywebsite.com - "

                    Again, I’m assuming this is not currently possible, or am I doing something wrong?

                    Otherwise, I think it would be a great added feature for the future.

                    thanks and thanks for the great documentation... it’s a great step in the right direction and hope it serves as a great example for other developers!
                      | Identity Developments delivers SEO focused web design and web presence services
                      - it&#39;s not about websites, it&#39;s about your identity. |
                      • 30223
                      • 1,010 Posts

                      I would like to be able to mix text and placeholders in the subject for the email, that way I can give the form submitter the opportunity to add their own subject information while also including some common text that could be used for filtering in an email client or at least help identify real emails versus spam.

                      Code:

                      &subject=`Contact from mywebsite.com - [.subject.]`



                      The [.subject.] part gets pulled from the form submission and included, but not the "Contact from mywebsite.com - "

                      The form field with the name subject has precedence over the snippet parameter, that’s why you are seeing that value. Todo what you want try naming the form field differently. For instance "fld_subject" and adjust the &subject paramter accordingly.
                      &subject=`Contact from mywebsite.com - [+fld_subject+]`

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