We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29626
    • 34 Posts
    Ok you have an example in the eform documentation.
    yourSiteURL/assets/snippets/eform/docs/eform_examples.htm


    HTML
    [+validationmessage+]
    <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+\s\w+/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="s" for="department">Subject</label>
        <select name="department">
            <option value="1">Website feedback</option>
            <option value="2">Support request</option>
            <option value="3">Feature request</option>
        </select></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> 
    


    Email Template
    <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>


    Thank you template
    <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>


    Snippet Call
    [!eForm? &formid=`feedbackForm` &to=`[email protected],[email protected],[email protected]` &tpl=`eFeedBackForm` &report=`eFeedbackReport` &thankyou=`eFeedbackThanks` &mailselector=`department` &vericode=`1` &subject=`Web site feedback`!]



    Now if I compare your form and the form in the documentation, I could see some things:


    • The mailselector is a select html tag which appears only one time with no eform pseudo attributes.
      You specify your company email addresses only in the snippet call;
    • Your label tags are surrounding the input tags when the official example close them before (id scope resolution)(maybe could put some mess?);
    • Remove comments... parsing could be not working well (test it lol);
    • Maybe many ideas later... I am still working on my job too wink
      • 4429
      • 429 Posts
      cool,

      will start from scratch rather than the multiple cut and paste job.

      Thanks for the help. Cheers.
        • 4429
        • 429 Posts
        This is stripped directly from the documentation. It works in terms of sending to different addresses, but many of the fields are blank.

        The email received is not showing the what the query is regarding.

        Here is the code:
        <div id="EmailForm">
        
        [+validationmessage+]
        <form method="post" action="[~[*id*]~]">
            <input type="hidden" name="formid" value="feedbackForm" />
            
            <p><label accesskey="n" for="Name">Your Name<br/></label>
            <input type="text" name="Name" maxlength="60" eform="Your Name::1:Expected at least two words:#REGEX /^\w+\s\w+/i" /></p>
        
            <p><label accesskey="e" for="email">Your Email Address<br/></label>
            <input type="text" name="email" size="40" maxlength="40" eform="Your Email Address:email:1" /></p>
            
            <p><label accesskey="s" for="department">Subject<br/></label>
            <select name="department">
                <option value="1" >General</option>
                <option value="2">Advertising</option>
                <option value="3">Editorial, PR & Media</option>
                <option value="4">Technical</option>
            </select></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> 
        
        </div>


        Here is the feedback:

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


        All is fine, but not sure what placeholder to use instad of [+subject+]


        The examples in the Wiki and on a deafult install are very different from what is found inthe eform documentation.
          • 16278
          • 928 Posts
          I’m doing what you want to do by using eForm events rather than the built-in multiple selection features. I am using a chunk for the selections and a TV for the addresses, that’s because I wanted to make it easy to update the selection options and email addresses without editing the snippet call. It’s a bit more complex, but it definitely works. (I think the built-in stuff works, too, I just didn’t want to load so much into a snippet parameter, and I had done something similar to base it on.)

          Can post the code if you wish.
          rolleyes KP
            • 4429
            • 429 Posts
            Thanks for the offer but i’d like to stick with this one for now.

            The documentation code has things like
            accesskey="n"
            etc.. in every input - These are not in the examples on a default install or in the wiki
              • 36416
              • 589 Posts
              Quote from: kp52 at Jan 28, 2010, 07:09 AM

              Can post the code if you wish.

              Please do.
                • 16278
                • 928 Posts
                @Eol: I’ve posted my code in a new thread at http://modxcms.com/forums/index.php/topic,45152.0.html to avoid cluttering this one up.
                grin KP