We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 26027
    • 145 Posts
    There has been much discussion about how to bring the form into view when error messages are placed there so that the user doesn't miss them. I'm using that technique and it's terriffic.

    However it's also important to present the eForm Thank You message to the user's attention by sending the message to an anchor in the form. My users are sitting at the top of the page with the form a screen or two down and have no idea whether they've been successful. Clearly the authors of eForm know how to do this because they're sending the messages there and should know how to establish an anchor and get to the anchor somehow.

    I've been all over the available eForm material and parameters and also took a look at the code (yikes!). I see no way to accomplish this. Surely many of you have been successful in accomplishing such a basic requirement.

    Can someone please point me to a successful implementation?

    Thanks in advance to anyone who can help ... Sam
      • 19369
      • 1,098 Posts
      The easiest way is to create another page with the thank you page, so there is no long form and the user see the message immediately.
        • 26027
        • 145 Posts
        microcipcip, I didn't want to devote a large web page to just say "Thank you, You were successful."

        I'm happy to say, however, that I came up with a solution that appears to work fine. Bottom line is that solution scrolls to the form under 3 circumstances:

        1. To present validation errors
        2. To say "Thank You"
        3. To tell the user they already submitted the form.

        The trick was to place an anchor on the form statement, attached to the "action" parameter. That has worked for me from the beginning, but only for validation errors.

        When the form was submitted and the thank you message is presented, eForm removed the form and along with it the anchor.

        So, I went to eForm's "english.inc.php" file and added the anchor to the Thank You and Multiple Submit messages.

        Putting it all together, here's the relevant form text, and the "english.inc.php" text:

        <a name="formbegin"></a>
        <p style="margin-top:0px">[+validationmessage+]</p>
         <form method="post" action="[~[*id*]~]#formbegin" id="joinournetwork">

        $_lang["ef_thankyou_message"] = "<a name='formbegin'></a><h3 id='jonty'>Thank You!</h3><p>Your information was successfully submitted.</p>";

        $_lang["ef_multiple_submit"] = "<a name='formbegin'></a><p>This form was already submitted succesfully. There is no need to submit your information multiple times.</p>";


        What helps this all to work is that after eForm removes the form it continues to uses the anchor on the subsequent messages.

        This all seems too simple to work. Hope this helps someone out there. It sure would have saved me considerable Googling and trial and error.

        Regards to all ... Sam


        [ed. note: samg last edited this post 14 years, 4 months ago.]
          • 19369
          • 1,098 Posts
          Nice solution!

          Shouldn't be better to use &thankyou paramenter with a chunk instead of editing the language file?
          &thankyou
          chunk name (non-numeric) or document id (numeric) to use as a thank you message displayed to the user after a successful submit. Tags: same as for &tpl

          The problem is, if you upgrade Evolution to a newer version, you may remove or overwrite the fix by mistake.