This is an updated version incorporating eForm and eFormParser into one file and which includes some enhancements:
- Powerful form validation using custom validation rules.
- A thank you template so you can add form values to the response page
- Language support - all eForm message are now stored in a language file so you can easily adapt it to your own language (or the language of your users
- Some minor tweaks, notably a change in the validation messages
- Fixes to a few bugs that nobody had noticed yet
<p><span style="color:#900;">[+validationmessage+]</span></p>
<form method="post" action="[~[*id*]~]">
<input type="hidden" name="formid" value="feedbackForm" />
<p><label accesskey="n" for="Name">Your Name</label>
<input type="text" name="Name" maxlength="60" eform="Your Name::1:Expected at least two words:#REGEX /\w+\b\w{2,}/i" /></p>
<p><label accesskey="e" for="email">Your Email Address</label>
<input type="text" name="email" size="40" maxlength="40" eform="Your Email Address:email:1" /></p>
<p><label accesskey="c" for="comments">Comments</label>
<textarea cols="40" rows="10" name="comments" eform="Comments:html:1"></textarea></p>
<p>
Please enter the anti spam code below:<br />
<img src="[+verimageurl+]" alt="verification code" border="1"/>
</p>
<p>
<label accesskey="c" for="vericode">code</label>
<input type="text" name="vericode" size="20" />
</p>
<p><input type="submit" name="submit" value="Send Feedback"></p>
</form>
<h3>Thank you for your feedback</h3> <p>We know how you appreciate our ongoing efforts and thank you for your praise. We will take any suggestions you may have made to heart and will endeavor to respond to you in a timely manner. However as all office staff is attending our 4 week annual company retreat, this year held in the Costa Del Sol, we ask for your patience.</p> <p>Below is a copy of your message:</p> <table> <tr><td>Your name:</td><td>[+Name+]</td></tr> <tr><td>Your email address</td><td>[+email+]</td></tr> <tr valign="top"><td>Your comments</td><td>[+comments+]</td></tr> </table>
<p>This is a response sent by [+Name+] using the feedback form on the website. The details of the message follow below:</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>comments:</td><td>[+comments+]</td></tr> </table> <p>You can use this link to reply: <a href="mailto:[+email+]?subject=RE:[+subject+]">[+email+]</a></p>
[[eForm? &formid=`feedbackForm` &to=`[email protected]` &tpl=`eFeedBackForm` &report=`eFeedbackReport` &thankyou=`eFeedbackThanks` &vericode=`1` &subject="Web site feedback"]]
[!eForm? &formid=`emailContactForm` &fromname=`[+name+]` &from=`[+email+]` &to=`[(emailsender)]` &subject=`[+subject+]` &tpl=`EmailForm` &report=`EmailReport` &thankyou=`EmailSent` &vericode=`1`!]
The installation instructions mention that the snippet should be inside a folder called eform. But the snippet seems to like to be in a folder called eformx, or else it will throw some errors
I’ve updated the repository so it has the correct pathIt seems that the [+name] and [+email+] placeholders can’t be used in the snippet call anymore? When I call the snipped this way:
Code:
[!eForm? &formid=`emailContactForm` &fromname=`[+name+]` &from=`[+email+]` &to=`[(emailsender)]` &subject=`[+subject+]` &tpl=`EmailForm` &report=`EmailReport` &thankyou=`EmailSent` &vericode=`1`!]
and after using the form, the email sent has "From" field set to "[+name+] <[+email+]>". The "Subject" field is set correctly though (it’s not set to "[+subject+]").
This discussion is closed to further replies. Keep calm and carry on.