Finally had some time to add the bits and pieces suggested in the various forum topics. Before I post it in the repository I’d like a few people to test and comment on the changes...
Update 11 December 2006
eform 1.4.2 has now been
added to the repository There are some extra additions which are listed below
- New: validation message placeholder no longer requires wrapping elements - You should now just use [+validationmessage+]
instead of <div clas="error">[+validationmessage+]</div> (or similar)
You can use the $_lang[’ef_validation_message’] in your eform language file to format
the message. Add [+ef_wrapper+] to this variable where you want the messages to appear
- New: You can now place the anywhere in your document (outside the form template)
- New: Support for in-line validation alert via the new &requiredClass and &invalidClass parameters
- New: Email character set now follows the modx setting (thanks to Gildas)
- Update: Tweaked the sessionVars parameter so it’s no longer sensitive to spaces in comma seperated values
- Update: Changed the date validation due to php version differences (Raymond Irving)
- New: &css parameter - Adds css to the head of the document when the form is displayed
- New: &jscript parameter - Adds javascript to the head of the document when form is displayed
- New: eForm now checks for version differences between snippet and eform.inc.php
- New: &protectSubmit parameter - protect against multiple submits of similar form data
values: 0=off, 1=use required fields, or comma separated list of fields to compare
- New: &submitLimit parameter - Time limit in minutes on successive submits of same form
- works standalone or in combination with &protectSubmit - see documentation for details
And a bit more info on the new parameters:
&cssStyle
Adds a style declaration to the <head> section of the page when either the form is displayed or the thank you page is displayed (if the &thankyou parameter is set). Values can be a combination of paths, full urls, chunk names and doc id’s.
Examples:
[!eForm &cssStyle=`assets/site/forms.css,chunkName` ... !]
[!eForm &cssStyle=`chunkName` ... !]
[!eForm &cssStyle=`http://mysite.com/assets/styles/forms.css` ... !]
Chunks (and documents if a doc id is given) can return a values in the form of:
an inline style block, eg. <style type="text/css">/*some styles*/</style>
a link to stylesheet(s), eg. <link href="assets/site/forms.css" rel="stylesheet" type="text/css">
a comma separated list of urls, eg. assets/site/forms.css,assets/site/more.css,assets/site/gone_overboard.css
&jScript
Similar to &cssStyle but for adding javascript to the <head> of the page document. Currently Javascript is only added when the form is displayed.
&protectSubmit - defaults to 1 (on)
Protects against submitting a form multiple times with the same data. Submitting the form becomes disabled after the first successful submit while the value from key form fields remains the same. This is achieved by setting (and comparing) a session variable with an md5 hash from these key fields. Which fields are compared depends on the value of &protectSubmit. Possible values are 0 (off), 1 (all ’required’ fields are used) or you can set a comma separated list of field names. To ensure that the session variable works separatedly for different forms the session variable name is based on the &formid paramter ({formid}_hash).
&submitLimit - off (0) by default
Enforces a time limit (in minutes) between form submits. After the form has been submitted successfully it can not be submitted again for the set amount of minutes irrespective of the form data being changed. When used in combination with &protectSubmit &submitLimit takes precedence, meaning that when the time limit has expired the form can be submitted again regardless of the setting of &protectSubmit (it will unset the session variable). As with &protectSubmit this parameter uses a session variable with a variable name based on &formid.