We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33409
    • 8 Posts
    I have created a form on my website using the eform example provided in the docs section of the eform snippet. Everything seems to be working great the only problem I have is I want the from address to be the email address that is entered when the form is submitted. Below is the code for the chunk and then the call I put on the page. If someone could help point me in the right direction I would appreciate it!

    eFeedBackForm Chunk
    -------------------------------------------------

    [+validationmessage+]
    <form method="post" action="[~[*id*]~]">
    <input type="hidden" name="formid" value="feedbackForm" />

    <p class="contactlist"><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 class="contactlist">
    <label accesskey="e" for="email">Your Email Address</label>
    <input type="text" name="email" size="31" maxlength="40" eform="Your Email Address:email:1" /></p>

    <p class="contactlist"><label accesskey="s" for="department">Subject</label>
    <select name="department">
    <option value="1">Extension Problem</option>
    <option value="2">Call Quality</option>
    <option value="3">Service Down Hard</option>
    </select></p>

    <p class="contactlist"><label accesskey="c" for="comments">Comments</label>

    <textarea cols="40" rows="10" name="comments" eform="Comments:html:1"></textarea></p>

    <p class="contactlist">
    Please enter the anti spam code below:

    <img src="[+verimageurl+]" alt="verification code" border="1"/>
    </p>
    <p class="contactlist">
    <label accesskey="c" for="vericode">code</label>
    <input type="text" name="vericode" size="20" />
    </p>

    <p class="contactlist"><input type="submit" name="submit" value="Submit Case"></p>
    </form>

    ---------------------------------------------------



    Code on page
    ---------------------------------------------------
    [!eForm? &formid=`feedbackForm` &from=`1` &to=`[email protected]` &tpl=`eFeedBackForm` &report=`eFeedbackReport` &thankyou=`eFeedbackThanks` &vericode=`1` &subject=`Web site feedback`!]

      • 33337
      • 3,975 Posts
      try &from=`email` or &from=`((email))`
        Zaigham R - MODX Professional | Skype | Email | Twitter

        Digging the interwebs for #MODX gems and bringing it to you. modx.link
        • 33409
        • 8 Posts
        Thanks zi the &from=`((email))` worked like a champ.

        Now say I wanted to use the "department" as the subject. I tried &subject=`((department))` and it gave me the option value "1" as the subject instead of the text "Extension Problem".

        Any ideas on how to make it use the diplayed text as the subject instead of the option value?
          • 33337
          • 3,975 Posts
          Make these:
              <option value="1">Extension Problem</option>
              <option value="2">Call Quality</option>
              <option value="3">Service Down Hard</option>

          into these:
              <option></option>
              <option value="Extension Problem">Extension Problem</option>
              <option value="Call Quality">Call Quality</option>
              <option value="Service Down Hard">Service Down Hard</option>
            Zaigham R - MODX Professional | Skype | Email | Twitter

            Digging the interwebs for #MODX gems and bringing it to you. modx.link
            • 33409
            • 8 Posts
            Worked great. Thanks!
              • 4080
              • 139 Posts
              For what it’s worth I had the same problem with a site. I created an email account for the from email address I wanted to use and worked. However it worked on the dev site which is with the same host provider. I think it might have to do with whether you have any email accounts set up--if you have none I don’t think you need to create one for it to work.
                • 28625
                • 24 Posts
                This worked for me (I get the sender’s address and can reply to them) but the actual name in the reply to field displays as "[+firstnames)". I can’t seem to get the inputted name to appear.
                  • 4080
                  • 139 Posts
                  Do you know if the placeholder in the code has the proper closing bracket(s)?I noticed you had a ")" at the end You mentioned that Forgive me if you’re already familiar with placeholder syntax but the firstname placeholder tag(s) should look like one of the following:

                  Evolution: [+firstname+]
                  Revolution: [[+firstname]]

                  At least I think "firstname" is an actual placeholder for both versions. Kinda wingin’ it here per usual.

                  Full syntax differences between the two versions here: http://rtfm.modx.com/display/revolution20/Tag+Syntax

                  Hopefully this helps?
                    • 28625
                    • 24 Posts
                    Hi Brian,
                    Thanks for the speedy response. I’m using the Evoution (version 0.9.6.3) and I’m a real novice at this (or just plain thick, more likely)! Yes, I do have the placenames as placeholders. Here’s part of my code for the page itself:
                    &from=`((email))` &fromname=`((firstnames)) ((surname1)) ((surname2))`

                    In the Form I have this:
                    <tr>
                        <td width="130"><label for="surname1">Surname</label></td>
                        <td width="20"> </td>
                        <td width="350"><input name="surname1" type="text" id="surname1" size="30" eform="surname1:string:1" /></td>
                        </tr>
                      <tr>
                        <td><label for="surname2">2nd Surname</label></td>
                        <td> </td>
                        <td><input name="surname2" type="text" id="surname2" size="30" eform="surname2::" /></td>
                        </tr>
                      <tr>
                        <td><label for="firstnames">First Name(s)</label></td>
                        <td> </td>
                        <td><input name="firstnames" type="text" id="firstnames" size="30" eform="firstnames:string:1" /></td>
                        </tr>
                    

                    And in the report (which all displays fine in the body of email) I have this:
                    <tr valign="top"><td>Name:    </td><td>[+firstnames+] [+surname1+] [+surname2+]</td></tr>

                    It’s not a really big deal but it’s just annoying. The main thing is that I can reply directly to the clients and that works fine. Cheers. Chris.