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

    I want to propose the following permanent addition to the "eForm" code:

    After using this helpful tool, I realized I needed to specify a chunk for the $_lang messages that are displayed when something goes wrong besides the fields validation. I.e. when the user decides to Refresh a form that was already posted, even after the &thankyou chunk told him/her that everything went ok (it happens).

    Normally, eForm will use the template of the collecting form and will output the message "<p>This form was already submitted successfully. There is no need to submit your information multiple times.</p>" as defined in the $_lang[’ef_multiple_submit’] variable directly where the [*#content*] tag goes.

    However, I wanted to add complex HTML code to surround the message without the need to add those <strong> and <p> tags to each $_lang entry. So I added a new parameter that behaves the same way the &thankyou and the &tpl are used inside the eForm snippet.

    The new snippet parameter, named "&errorTemplate" will be used as follows:

    [!eForm? &formid=`contacts`[b]&errorTemplate=`errorEform`[/b] &eformOnBeforeMailSent=`codeValues` &ccsender=`1 &to=`[email protected]` &tpl=`contactForm` &report=`feedbackContactForm` &thankyou=`feedbackForm` &vericode=`1` &subject=`Contact page`!]


    Then, inside the chunk or document id that has the desired HTML, we need to place a new tag named [+errorMessages+] that will be substituted with the $_lang message text.

    Example:
    This code is located inside of my ’errorEform’ chunk:

    <html> .... <body> .... <tr>
      <td align="justify" valign="top"><div class="errors">[+errorMessages+]</div></td>
     </tr>


    and that’s it!!

    NOTE: In case the optional parameter errorTemplate is not specified, then the application outputs the $_lang message as always.

    Attached to this post you will find the eForm files eform.inc.php and eform.snippet.tpl that make this work. Changes and additions inside the code are marked as "//Change by Jivan Miranda" to make them easy to be found.

    I Hope you will approve it.

    jivanro
      • 14219
      • 3 Posts
      Hi all,

      Attached you will find my proposal on the $_lang messages, translated to Spanish (Mexico).

      Regards,

      Jivan