We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30672
    • 180 Posts
    hi,

    i use eform with yams, but i have a problem.
    when i submit my form, the page is refreshed, form emptied,and nothing else, no email sent.

    here is my code:

    CALL:

    [!eForm? &language=`(yams_mname)` &formid=`eFormcontactForm_(yams_id)` &tpl=`eFormContactForm_(yams_id)` &report=`eFormContactReport_(yams_id)` &to=`XXXXXX`&subject=`YYYYYYYYYYYY` &thankyou=`eFormContactThankyou_(yams_id)`!]


    eFormContactForm_fr :

    [+validationmessage+]
    <form action="(yams_doc)" method="post">
    <input type="hidden" name="eFormContactForm_fr" value="eFormContactForm_fr">
    .....
    </form>
    



    eFormContactReport_fr
    <p>Message de la part de [+name+] depuis le site internet (formulaire en français).</p>
    <table>
    <tr valign="top"><td>Titre:</td><td>[+titre+]</td></tr>
    <tr valign="top"><td>Nom:</td><td>[+nom+]</td></tr>
    <tr valign="top"><td>Prénom:</td><td>[+prenom+]</td></tr>
    <tr valign="top"><td>Societe:</td><td>[+societe+]</td></tr>
    <tr valign="top"><td>Adresse:</td><td>[+adresse+]</td></tr>
    <tr valign="top"><td>NPA:</td><td>[+npa+]</td></tr>
    <tr valign="top"><td>Localité:</td><td>[+localite+]</td></tr>
    <tr valign="top"><td>telephone:</td><td>[+telephone+]</td></tr>
    <tr valign="top"><td>Email:</td><td>[+email+]</td></tr>
    <tr valign="top"><td>Commentaire:</td><td>[+comments+]</td></tr>
    </table>
    <p>Vous pouvez utiliser ce lien pour répondre: <a href="mailto:[+email+]?subject=RE:[+subject+]">[+email+]</a></p>
    


    can someone see the error ?

    thank you very much !
    • Can you use a standard eForm on a non-multilanguage page? Try using the &debug=`1` parameter and see if there is anything that looks wrong in the debug display.
        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
        • 30672
        • 180 Posts
        hi, thanks for the answer!

        no the contact form page must be multilingual.

        i allready tried the debug mode, but everything is ok. What error should i see?
        • When I have forms in YAMS-based sites, I don’t use the yams variables in the eForm calls or tpls. I just use a different chunk tpl for each language, and have an appropriate eForm snippet for each language. I know that is not as flexible, but I’ve never had a problem with it.

          What I meant by having an eForm working in a non-YAMS page was to see if eForm works on your site at all; it may have nothing at all to do with YAMS.

          What is the generated form’s action attribute, is that as it should be? What happens if the resource is uncached?

          I see you have the hidden field already; if you just make sure the form’s id attribute matches your formid parameter eForm will generate the hidden field at the bottom of the form by itself. In any case, is the generated form’s formid field attributes and value correct?
            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
          • Ah. I think I see the problem.
            <input type="hidden" name="eFormContactForm_fr" value="eFormContactForm_fr">

            should be
            <input type="hidden" name="formid" value="eFormContactForm_fr">
              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
              • 9995
              • 1,613 Posts
              can’t u just do a YAMS call, when fr then eform_fr, so u have Eforms for each language.
                Evolution user, I like the back-end speed and simplicity smiley
                • 30672
                • 180 Posts
                thank you very for all your answers !

                i will give it a try this afternoon or this evening and i’ll let you know if it works!

                  • 30672
                  • 180 Posts
                  Ok i found how to make it work, with 1 snippet (eform), 2 tpl for form and 2 tpl for Report.

                  here is the solution:

                  eform call for every language :

                  [!eForm? &language=`(yams_mname)` &formid=`eFormContactForm_(yams_id)` &to=`email` &tpl=`eFormContactForm_(yams_id)` &report=`eFormContactReport_(yams_id)`!]



                  Chunk "eFormContactForm_fr" for tpl in french

                  if you use alias from YAMS, as i do in this case, you muste write form action="(yams_doc)". Otherwise you can use action="[~[*id*]~]" (as i read it on this thread : http://modxcms.com/forums/index.php?topic=64814.0)

                  [+validationmessage+]
                  <form action="(yams_doc)" method="post" id="eFormContactForm_fr">
                  <input name="formid" type="hidden" value="eFormContactForm_fr" />
                  .......
                  </form>
                  


                  Chunk "eFormContactForm_en" for tpl in english

                  [+validationmessage+]
                  <form action="(yams_doc)" method="post" id="eFormContactForm_en">
                  <input name="formid" type="hidden" value="eFormContactForm_en" />
                  .......
                  </form>
                  


                  Chunk "eFormContactReport_en" for Report in english

                  Here is a mail from the website XXX, from english form
                  you can write whatever you want, just put the fields like [+name+]



                  Chunk "eFormContactReport_fr" for Report in french

                  Voici un mail depuis le site XXX, écrit avec le formulaire en français.
                  you can write whatever you want, just put the fields like [+name+]



                  And that’s all !
                  thanks again for helping me !
                  this forum is great, so when i can help a little bit...
                  do you think it’s possible to add this in the YAMS documentation, as a little example?
                    • 9995
                    • 1,613 Posts
                    PMS did a good job! +100

                    I don’t think it’s being updated thow, thats what’s told to me last time.

                      Evolution user, I like the back-end speed and simplicity smiley
                    • Yes, PMS hasn’t been able to continue development and support. But for 99.9% of the time, the latest stable version works very well.

                      Any application is going to have users with different requirements, and sometimes it just becomes impossible for one person to continue adding and modifying features to try to satisfy everybody. I know; I’ve had to abandon a few applications I found useful and shared, then had a constant stream of requests (and the occasional more insistent, if not downright rude, demand) that eventually were more than I could handle.
                        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