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

    I been trying to create a Form, with eForm and followed the instructions here
    http://wiki.modxcms.com/index.php/EForm

    what I did was
    -create a chunk called "ContactForm" inserted the code (from URL above)
    -create a document called "ContactFormReport" inserted the code (from URL above)
    -create another document and inserted "[!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[email protected]`
    &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`1` !]"

    It does not seem to work??? am I doing something wrong?
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      What about it is not working?
        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
        • 24904
        • 79 Posts
        it just does not work,

        I pulished both the form and the report document
        all I can see when viewing the form document is this line
        "[!eForm? &formid=`ContactForm` &subject=`[+subject+]` &to=`[email protected]`
        &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`1` !]" "

        By the way: im using the default "eForm" that came installed with modx.
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Ah! I’ll bet that you copy/pasted from the wiki page into a TinyMCE rich text field! What happened is that TinyMCE was very helpful and converted all the tags to HTML entities! They are converted back by the browser so you see them OK, but MODx needs the actual tags, not the HTML entities.

          Edit the document, and either turn off rich text editing for that document (on the Page Settings tab clear the Rich Text checkbox and save the document) or click on the little HTML button on the field’s toolbar and clean up the code in the raw HTML view that will pop up.

          With snippets with lots of parameters like eForm, you’re generally better off either not using a rich text editor for the document, or put the snippet call in a chunk and then use the chunk tags in your rich text editor.

          Another tip for when you do want to copy/paste from another web page is to open the HTML popup window and paste into that.
            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
            • 24904
            • 79 Posts
            I actually turned the WYSIWYG editor off!

            and copied and paste.

            I will try put it in the chunk and see what happens smiley
              • 24904
              • 79 Posts
              Quote from: sottwell at Sep 21, 2008, 05:24 AM

              .................put the snippet call in a chunk and then use the chunk tags in your rich text editor.

              Very strange,

              The way you suggested works!
              Now im confused why it’s working!!

              TEST #1
              I original had the following code in contractus document page (lets call it contractus.html)
              [[eForm? &formid=`ContactForm` &subject=`` &to=`[email protected]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`1` ]]

              it does not work!

              TEST #2
              I created a new "chunk" called "showContractForm", I then inserted the following code
              [[eForm? &formid=`ContactForm` &subject=`` &to=`[email protected]` &ccsender=`1` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`1` ]]

              I opened the contractus.html document and replaced the original code with the following code
              {{showContractForm}}


              IT WORKS! but why?

              ---By the way I turned of WYSIWYG Rich text editor, I always use plan text.
                • 3749
                • 24,544 Posts
                I can only think of two possibilities:

                1. There was a typo in your first snippet call. (Unless you cut and pasted the snippet call into the chunk, this is by far the most likely.)

                2. You fixed an earlier problem for during your first try, but had the old unfixed version in your site cache or browser cache.

                Maybe others will suggest more possibilities.
                  Did I help you? Buy me a beer
                  Get my Book: MODX:The Official Guide
                  MODX info for everyone: http://bobsguides.com/modx.html
                  My MODX Extras
                  Bob's Guides is now hosted at A2 MODX Hosting
                  • 24904
                  • 79 Posts
                  By the way reporting does not work (above)
                    • 24904
                    • 79 Posts
                    TEST #3
                    Document: Contact Us 
                    Alias: contact-us

                    [[eForm? &formid=`contact-us` &subject=`` &to=`[email protected]` &ccsender=`1` &tpl=`ContactForm` &report=`contact-us-form-report` &gotoid=`1` ]] 


                    Document: Contact Us Form Report
                    Alias: contact-us-form-report

                    <p>This is a response sent by <b>[+name+]</b> using the feedback form on this website. The details of the message follow below:</p>
                     
                    <p>Name: [+name+]</p>
                    <p>Email: [+email+]</p>
                    <p>Regarding: [+subject+]</p>
                    <p>Comments:<br />[+message+]</p>
                     
                    <p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE: [+subject+]">[+email+]</a></p>



                    Chunk: ContactForm
                    <p class="error">[+validationmessage+]</p>
                     
                    <form method="post" action="[~[*id*]~]" id="EmailForm">
                     
                    	<fieldset>
                    		<h3> Contact Us</h3>
                     
                    		<input name="formid" type="hidden" value="ContactForm" />
                     
                    		<label for="cfName">Your name:
                    		<p><input name="name" id="cfName" class="text" type="text" eform="Your Name::1:" /></p></label>
                     
                    		<label for="cfEmail">Your Email Address:
                    		<p><input name="email" id="cfEmail" class="text" type="text" eform="Email Address:email:1" /></p> </label>
                     
                    		<label for="cfRegarding">Regarding:
                    		<p><input name="subject" id="cfRegarding" class="text" type="text" eform="Form Subject::1" /></p> </label>
                     
                    		<label for="cfMessage">Message:
                    		<p><textarea name="message" id="cfMessage" eform="Message:textarea:1"></textarea></p>
                    		</label>
                     
                    		<label> </label><p><input type="submit" name="contact" id="cfContact" class="button" value="Send This Message" /></p>
                     
                    	</fieldset>
                     
                    </form>


                    Snippet: eForm

                    <?php
                    # eForm 1.4.4 - Electronic Form Snippet
                    # Original created by Raymond Irving 15-Dec-2004.
                    # Version 1.3+ extended by Jelle Jager (TobyL) September 2006
                    # -----------------------------------------------------
                    # local version: $Id: eform.snippet.tpl,v 1.2 2006/11/22 14:53:38 jelle Exp $
                    # Captcha image support - thanks to Djamoer
                    # Multi checkbox, radio, select support - thanks to Djamoer
                    # Form Parser and extened validation - by Jelle Jager
                    #
                    # see eform/docs/eform.htm for history, usage and examples
                    #
                    
                    # Set Snippet Paths
                    #new in 1.4.4 - sub-folder set by parameter
                    $snipFolder = isset($snipFolder)?$snipFolder:'eform';
                    $snipPath = $modx->config["base_path"].'assets/snippets/'.$snipFolder.'/';
                    
                    
                    # check if inside manager
                    if ($modx->isBackend()) {
                    return ''; # don't go any further when inside manager
                    }
                    
                    //tidying up some casing errors in parameters
                    if(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate;
                    if(isset($eformOnBeforeMailSent)) $eFormOnBeforeMailSent = $eformOnBeforeMailSent;
                    if(isset($eformOnMailSent)) $eFormOnMailSent = $eformOnMailSent;
                    if(isset($eformOnValidate)) $eFormOnValidate = $eformOnValidate;
                    if(isset($eformOnBeforeFormMerge)) $eFormOnBeforeFormMerge = $eformOnBeforeFormMerge;
                    if(isset($eformOnBeforeFormParse)) $eFormOnBeforeFormParse = $eformOnBeforeFormParse;
                    //for sottwell :)
                    if(isset($eFormCSS)) $cssStyle = $eFormCSS;
                    
                    # Snippet customize settings
                    $params = array (
                       // Snippet Path
                       'snipPath' => $snipPath, //includes $snipFolder
                    	 'snipFolder' => $snipFolder,
                    
                    // eForm Params
                       'vericode' => isset($vericode)? $vericode:"",
                       'formid' => isset($formid)? $formid:"",
                       'from' => isset($from)? $from:$modx->config['emailsender'],
                       'fromname' => isset($fromname)? $fromname:$modx->config['site_name'],
                       'to' => isset($to)? $to:$modx->config['emailsender'],
                       'cc' => isset($cc)? $cc:"",
                       'bcc' => isset($bcc)? $bcc:"",
                       'subject' => isset($subject)? $subject:"",
                       'ccsender' => isset($ccsender)? 1:0,
                       'sendirect' => isset($sendirect)? 1:0,
                       'mselector' => isset($mailselector)? $mailselector:0,
                       'mobile' => isset($mobile)? $mobile:'',
                       'mobiletext' => isset($mobiletext)? $mobiletext:'',
                       'autosender' => isset($autosender)? $autosender:$from,
                       'autotext' => isset($automessage)? $automessage:"",
                       'category' => isset($category)? $category:0,
                       'keywords' => isset($keywords)? $keywords:"",
                       'gid' => isset($gotoid)? $gotoid:$modx->documentIdentifier,
                       'noemail' => isset($noemail)? ($noemail):false,
                       'saveform' => isset($saveform)? ($saveform? true:false):true,
                       'tpl' => isset($tpl)? $tpl:"",
                       'report' => isset($report)? $report:"",
                       'allowhtml' => isset($allowhtml)? 1:0,
                       //Added by JJ
                       'replyto' => isset($replyto)? $replyto:"",
                       'language' => isset($language)? $language:$modx->config['manager_language'],
                       'thankyou' => isset($thankyou)? $thankyou:"",
                       'isDebug' => isset($debug)? $debug:0,
                       'reportAbuse' => isset($reportAbuse)? $reportAbuse:false,
                       'disclaimer' => isset($disclaimer)?$disclaimer:'',
                       'sendAsHtml' => isset($sendAsHtml)?$sendAsHtml:false,
                       'sendAsText' => isset($sendAsText)?$sendAsText:false,
                       'sessionVars' => isset($sessionVars)?$sessionVars:false,
                       'postOverides' => isset($postOverides)?$postOverides:0,
                       'eFormOnBeforeMailSent' => isset($eFormOnBeforeMailSent)?$eFormOnBeforeMailSent:'',
                       'eFormOnMailSent' => isset($eFormOnMailSent)?$eFormOnMailSent:'',
                       'eFormOnValidate' => isset($eFormOnValidate)?$eFormOnValidate:'',
                       'eFormOnBeforeFormMerge' => isset($eFormOnBeforeFormMerge)?$eFormOnBeforeFormMerge:'',
                       'eFormOnBeforeFormParse' => isset($eFormOnBeforeFormParse)?$eFormOnBeforeFormParse:'',
                       'cssStyle' => isset($cssStyle)?$cssStyle:'',
                       'jScript' => isset($jScript)?$jScript:'',
                       'submitLimit' => (isset($submitLimit) &&  is_numeric($submitLimit))?$submitLimit*60:0,
                       'protectSubmit' => isset($protectSubmit)?$protectSubmit:1,
                       'requiredClass' => isset($requiredClass)?$requiredClass:"required",
                       'invalidClass' => isset($invalidClass)?$invalidClass:"invalid",
                       'runSnippet' => ( isset($runSnippet) && !is_numeric($runSnippet) )?$runSnippet:'',
                       'autoSenderName' => isset($autoSenderName)?$autoSenderName:'',
                       'version' => '1.4.4'
                    );
                    
                    # Start processing
                    
                    include_once ($snipPath."eform.inc.php");
                    
                    $output = eForm($modx,$params);
                    
                    # Return
                    return $output;
                    ?>


                    Note: Report still does not work!
                      • 3749
                      • 24,544 Posts
                      I think the report is supposed to be a chunk, not a document.
                        Did I help you? Buy me a beer
                        Get my Book: MODX:The Official Guide
                        MODX info for everyone: http://bobsguides.com/modx.html
                        My MODX Extras
                        Bob's Guides is now hosted at A2 MODX Hosting