We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 13825
    • 55 Posts
    I seem to have a problem whereby dynamic placeholders used within the &subject parameter do not get picked up.
    Here’s the snippet call:

    [!eForm? &formid=`ContactForm` &subject=`[+name+]` &to=`[email protected]` &tpl=`ContactForm` &report=`ContactFormReport` &gotoid=`14` !]


    Here’s the form:

    <form method="post" action="[~[*id*]~]" id="ContactForm" name="ContactForm" class="basic">
    	<fieldset>
     
    		<input name="formid" type="hidden" value="ContactForm" />
     		<ol>
    			<li>
    			  <label for="name">Your name:</label>
    			  <input name="name" id="name" class="text" type="text" eform="Your Name::0:" />
    			</li>
    			<li>
    			  <label for="email">Your Email:</label>
    			  <input  name="email" id="email" class="text" type="text" eform="Email Address:email:1"  />
    			</li>
    			 
      			<li>
    			  <label for="message">Message:</label>
    			 <textarea rows="5" cols="30" class="text t-area" name="message" id="message" eform="Message:textarea:1"></textarea>
    			</li>
    			<li class="submit">
    			 <label> </label>
    			 <input type="image" src="/img/buttons/send.gif"  name="contact" id="cfContact" class="button" value="Send" />
    			</li>
    		</ol>
      	</fieldset>
     </form>


    All the details come through on the report but in the subject of the email I get "0" (the number zero)
    However, if I change the subject param to:
    &subject=`message from [+name+]`
    I just get "message from"

    Very strange...

    Also could someone point me to some documentation of the eform attribute as I haven’t found any smiley thanks

    I’m using modx 0.9.5 and eform 1.4.3

    Your help would be much appreciated.

      • 2896
      • 70 Posts
      Hi,

      I don’t think the &subject parameter accepts dynamic content with placeholders such as [+name+] , unless you have another approach of setting this value into the snippet call. ... TobyL or others may help you more with that

      Why not give a general subject line with &subject=`Mail sent by domain.com`

      And have the details of the [+name+] included in a report "contactformreport":
      f.i.
      <p>Deze mail werd gestuurd door "[+name+]" via de website domain.com. Details van dit bericht:</p>
      <table>
      <tr valign="top"><td>Naam:</td><td>[+name+]</td></tr>
      <tr valign="top"><td>Email:</td><td>[+email+]</td></tr>
      <tr valign="top"><td>Onderwerp:</td><td>[+Onderwerp+]</td></tr>
      <tr valign="top"><td>Bericht:</td><td>[+Bericht+]</td></tr>
      </table>
      



      The call to eform is then like this:
      [!eForm? &formid=`contactform` &tpl=`contactform` &to=`[email protected]` &report=`contactformreport` &subject=`Vraag via site pcvo-gent.net` &vericode=`1`!]

      Hope this helps
        • 13825
        • 55 Posts
        According to TobyL (who I think wrote the snippet) you should be able to have any placeholder from the form.
        See his explanation: http://modxcms.com/forums/index.php/topic,10720.msg72768.html#msg72768
          • 30223
          • 1,010 Posts
          Yes, that’s more or less correct. I just copied and pasted your form template and snippet call and the subject displayed the name fine. It is as if the name field is seen as a number or boolean value. I did notice that you have the name set as a none-required field though. Did whoever posted the form fill in a name at all? If they didn’t this behaviour makes sense, otherwise I’m at a loss why this wouldn’t work for you. .

          Perhaps change the name field to:
          <input name="name" id="name" class="text" type="text" eform="Your Name:string:1:" />


          As far as documentation goes look in assets/snippets/eform/docs/eform.htm
            • 2896
            • 70 Posts
            Quote from: jdelight at Feb 24, 2007, 10:46 PM

            According to TobyL (who I think wrote the snippet) you should be able to have any placeholder from the form.
            See his explanation: http://modxcms.com/forums/index.php/topic,10720.msg72768.html#msg72768

            You are right! I was thinking about the dynamic content of using a tv as parameter option. My apologies
              • 2896
              • 70 Posts
              Could it not be that two attributes "name" and "id" is causing this?

              <input name="name" id="name" class="text" type="text" eform="Your Name:string:1:" />


              My [+Naam+] placeholder comes through in the subject line. I have

              <input type="text" name="Naam" maxlength="60" size="40" eform="Uw naam::1" />

              as input tag.

              The documentation of TobyL also doesn’t mention
              <input name="name" id="name"