We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 35944
    • 5 Posts
    Ok, bear with me please, I am a "publisher" account in our modx manager, however have access to most things. I am having difficulty getting eforms to work. I will provide my non working code, followed by 2 working codes. The only difference is the "admin" account when saving the forms makes them work, but my publisher account doesn’t, we are trying to figure out why.

    Non-Working
    Form
    [+validationmessage+]
    <form method="post" action="[~[*id*]~]">
        <input type="hidden" name="formid" value="volunteerForm" />
        
    	<ul class="comment-form">
    			<li><input type="text" name="name" id="name" title="Your Name" eform="Your Name::1:Expected at least two words:#REGEX /^\w+\s\w+/i" /></li>
    			<li><input type="text" name="email" id="email" title="Your E-mail" eform="Your Email Address:email:1" /></li>
    			<li><input type="text" name="phone" id="phone" title="Phone Number" /></li>
    			<li class="comment-area"><textarea name="content" id="content" cols="50" rows="9" title="Let us now how you feel you can help!" eform="content:html:1" /></textarea></li>
    	</ul>
    	<input type="submit" name="submit" value="Send Information">
    </form> 


    Form Output
    [[eForm? &formid=`volunteerForm` &to=`[email protected]` &tpl=`volunteerForm` &report=`volunteerFormReport` &gotoid=`89` &subject=`Volunteer!`]]


    Form Report
    <p>This is a story sent by [+name+] from the I want to volunteer page.</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>Phone:</td><td>[+phone+]</td></tr>
    <tr valign="top"><td>Comments:</td><td>[+content+]</td></tr>
    </table>
    <p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE:[+subject+]">[+email+]</a></p>

    Non Working form link -> http://pfjrfoundation.org/multiple-sclerosis/volunteer/join-us.php

    Working Form 1
    [+validationmessage+]
    <form method="post" action="[~[*id*]~]">
        <input type="hidden" name="formid" value="contactForm" />
        
    	<ul class="comment-form">
    			<li><input type="text" name="name" id="name" title="Your Name" eform="Your Name::1:Expected at least two words:#REGEX /^\w+\s\w+/i" /></li>
    			<li><input type="text" name="email" id="email" title="Your E-mail" eform="Your Email Address:email:1" /></li>
    			<li><input type="text" name="phone" id="phone" title="Phone Number" /></li>
    			<li class="comment-area"><textarea name="content" id="content" cols="50" rows="9" title="Tell Us About Your Story" eform="content:html:1" /></textarea></li>
    	</ul>
    	<input type="submit" name="submit" value="Send Story">
    </form> 


    Output
    [[eForm? &formid=`contactForm` &to=`[email protected]` &tpl=`contactForm` &report=`contactFormReport` &gotoid=`69` &subject=`Someone Sent a Story!`]]


    Report
    <p>This is a story sent by [+name+] from the I Have a Story to Share page.</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>Phone:</td><td>[+phone+]</td></tr>
    <tr valign="top"><td>Comments:</td><td>[+content+]</td></tr>
    </table>
    <p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE:[+subject+]">[+email+]</a></p>

    Working form 1 link -> http://pfjrfoundation.org/multiple-sclerosis/stories/submit-story.php

    Working form 2
    [+validationmessage+]
    <form method="post" action="[~[*id*]~]">
        <input type="hidden" name="formid" value="mcContact" />
        
    	<ul class="comment-form">
    			<li><input type="text" name="name" id="name" title="Your Name" eform="Your Name::1:Expected at least two words:#REGEX /^\w+\s\w+/i" /></li>
    			<li><input type="text" name="email" id="email" title="Your E-mail" eform="Your Email Address:email:1" /></li>
    			<li><input type="text" name="phone" id="phone" title="Phone Number" /></li>
    			<li class="comment-area"><textarea name="content" id="content" cols="50" rows="9" title="Send us a Message" eform="content:html:1" /></textarea></li>
    	</ul>
    	<input type="submit" name="submit" value="Send Message">
    </form> 


    Output
    [[eForm? &formid=`mcContact` &to=`[email protected]` &tpl=`mcContact` &report=`mcContactReport` &gotoid=`89` &subject=`Summer Bash!`]]


    Report
    <p>This is a message sent by [+name+] from the Summer Bash contact us page.</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>Phone:</td><td>[+phone+]</td></tr>
    <tr valign="top"><td>Comments:</td><td>[+content+]</td></tr>
    </table>
    <p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE:[+subject+]">[+email+]</a></p>

    Working form 2 link -> http://pfjrfoundation.org/multiple-sclerosis/summer-bash/summer-bash-contact.php


    I’m really at a complete loss, any help would be great. Thank you.
    Modx evolution
      • 28042 ☆ A M B ☆
      • 24,524 Posts
      Are you saying that none of these will work if you are using the "publisher" account, but all of them work when using the Administrator account? Are you sure that the resource that you are working with is NOT cached? If the resource is cached and the snippet call is also cached then the form of course cannot work, since it’s been cached the first time around and there’s no snippet to process the POST. If the resource is cached the snippet call must be uncached [!eForm? ... !]
        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
        • 35944
        • 5 Posts
        I cleared the cache with [!eform ... !] as well as clicking site in the manager and clicking clear cache.

        I wrote the mcContact form and the volunteerForm. The administrator wrote the contactForm and it works, and after having him login under the administrator account and save the mcContact form it worked. I had him login just to ensure that my coding was correct, he said he saw nothing wrong with it, saved it, and then it worked. Am just trying to figure out what I am missing, Thank you so much for your suggestion, I too am still searching around for possible answers.

        Sincerely,

        Sean
          • 35944
          • 5 Posts
          I am still having trouble with forms, same code as posted above, the view sources is different though.

          Non-Working View Source Page
          <p>
          <form method="post" action="multiple-sclerosis/volunteer/join-us.php">
              <input type="hidden" name="formid" value="volunteerForm" />
              
          	<ul class="comment-form">
          			<li><input type="text" name="name" id="name" title="Your Name" eform="Your Name::1:Expected at least two words:#REGEX /^\w+\s\w+/i" /></li>
          			<li><input type="text" name="email" id="email" title="Your E-mail" eform="Your Email Address:email:1" /></li>
          
          			<li><input type="text" name="phone" id="phone" title="Phone Number" /></li>
          			<li class="comment-area"><textarea name="content" id="content" cols="50" rows="9" title="Let us now how you feel you can help!" eform="content:html:1" /></textarea></li>
          	</ul>
          	<input type="submit" name="submit" value="Send Information">
          </form> </p>


          Working #1
          <form method="post" action="multiple-sclerosis/stories/submit-story.php">
              <input type="hidden" name="formid"  value="contactForm" />
              
          	<ul class="comment-form">
          			<li><input type="text" name="name" id="name" title="Your Name"  value="" /></li>
          			<li><input type="text" name="email" id="email" title="Your E-mail"  value="" /></li>
          			<li><input type="text" name="phone" id="phone" title="Phone Number"  value="" /></li>
          
          			<li class="comment-area"><textarea name="content" id="content" cols="50" rows="9" title="Tell Us About Your Story" ></textarea></li>
          	</ul>
          	<input type="submit" name="submit"  value="Send Story" />
          </form> </p>


          Working #2
          					<p>
          <form method="post" action="multiple-sclerosis/summer-bash/summer-bash-contact.php">
              <input type="hidden" name="formid"  value="mcContact" />
              
          	<ul class="comment-form">
          			<li><input type="text" name="name" id="name" title="Your Name"  value="" /></li>
          			<li><input type="text" name="email" id="email" title="Your E-mail"  value="" /></li>
          			<li><input type="text" name="phone" id="phone" title="Phone Number"  value="" /></li>
          			<li class="comment-area"><textarea name="content" id="content" cols="50" rows="9" title="Send us a Message" ></textarea></li>
          	</ul>
          
          	<input type="submit" name="submit"  value="Send Message" />
          </form> </p>


          Note that the difference in mine from the 2 he created is instead of his view source saying eform="..." it says value="", however if you look at my original post all of our code is the same. I believe this is a permission option somewhere, could someone weigh in on this and let me know what you think?

          Sincerely,

          Sean Davis
          [email protected]
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Yes, the eform attribute is converted by eForm itself. It should never appear in the "view source" of the final generated page. I really can’t see how there can be a difference in how the snippet is processed because of the role of whoever saved the chunks. Are you by any chance using the Rich Text editor when editing chunks, and the administrator user is not? It appears that for some reason the eform attribute is not recognized when it’s saved by your user, while it is when saved by the administrator user.
              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
              • 35944
              • 5 Posts
              No, I do not use the rich text editor and neither does he. Thank you for trying to help me figure this out Sottwell, your time and energy is appreciated.

              Sincerely,

              Sean Davis
                • 28042 ☆ A M B ☆
                • 24,524 Posts
                This is very odd. Add the parameter &debug=`1` to your eForm snippet call and see what it has to say. Do other eForm calls work properly for you, or is it only this one that is behaving this way?
                  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
                  • 35944
                  • 5 Posts
                  [!eForm? &debug=`1` &formid=`volunteerForm` &to=`[email protected]` &tpl=`volunteerForm` &report=`volunteerFormReport` &gotoid=`89` &subject=`Volunteer!`!]


                  I do not see the debug producing anything, and this is the only form currently doing this, I made a form previously, it was doing the same thing, I had the administrator login to double check my code and he didn’t find anything wrong with it, but when he hit saved it worked. I currently need to make 2 more forms, however am holding off until we can figure out why my forms, although all code is correct, won’t work. The administrator is the person who designed the site, I am a volunteer who is taking it over now that the design is done, and am in charge of adding content/removing content, updating the site, and maintaining it.

                  Thank you again smiley
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Have you tried this using a different browser? Also try it turning off the rich text editor for the resource with the eForm call. The debug parameter should produce a big red warning message and a long list of eForm settings.
                      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