We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23420
    • 6 Posts
    Hi I might be approaching this from the wrong angle but would appreciate any ideas.

    I have a quote request form which uses eform on my website which is working fine. I now want to format the report so it produces what we call our enquiry form that we can then print off rather than filling it in manually.

    The bit I am struggling with is the date. Is there a way to get the form to send the date on which is was submitted as a field without the user having to input it, i.e. a hidden field? Or is there a simple way I’m missing?


    Thanks.
      • 12477
      • 5 Posts
      There’s probably a jabijillion ways to do it grin

      You *could* make a template variable called "current-date" and in it :

      @EVAL return date("F j, Y, g:i a");
      


      where the date function is from : http://php.net/manual/en/function.date.php.

      In your template, have a hidden field with :

      <input type="hidden" name="currentdate" value="[*current-date*]" />
      


      http://wiki.modxcms.com/index.php/EForm#Hidden_fields for more info.

      Otherwise, if you don’t like to use the @EVAL, make yourself a quick snippet, and have :

      <input type="hidden" name="currentdate" value="[[current-date-snippet]]" />
      


      Aware of course, that your eform is uncached ([! !])

        • 13226
        • 953 Posts
        @Pinky

        Take a look at the eForm Snippet Parameters


        Special placeholders available are: [+validationmessage+], [+postdate+],[+verimageurl+] & [+debugText+]. You should have the [+validatiomessage+] placeholder in all your forms. The others you may need depending on other parameters.

        Add "[+postdate+]" to your eform report - its that easy.

        I use the code below in my eForm report:
        <tr>
          <td>Form Submitted on:</td>
          <td><strong>[+postdate+]</strong></td>
        </tr>
        
        Output in email = Form Submitted on: 09-Feb-2010 20:58:49
        


        Cheers
          • 23420
          • 6 Posts
          Thank you for your help! [+postdate+] worked fine - very simple lol new I was missing something smiley