Inspired by this support request
http://www.mightyextensions.com/support-desk-forum/item/tickets-topics/32-resources/24207-text-field-and-custom-preg-match
some modifications were done to the original Text 2.0 Field Plugin for Resources 1.5:
1) Combined the different existing validation scripts into 1 script
2) Moved the validation script to the header
3) Removed all unnecessary redundant validations from OnBeforeSave function
4) Simplified the custom field - accepts now a regular expression instead of a full script
5) Added a default regular expression to the custom validation field (http://regexlib.com/REDetails.aspx?regexp_id=186)
6) Removed unnecessary generated HTML tags ('Sign Before'/'Sign After' if empty)
7) Added index.html to html folder
Any regular expression can now be copied to the custom validation field, without the need of a full javascript.
A good start and source of regular expressions is :
http://regexlib.com
09 August 2010
1) Validation script update - all text_terix 2.0 fields in a form will share the same validation script
2) Moved script to external JS file for better caching/merging through 3rd party optimizer like JFinalizer, CssJsCompress, IceSpeed, RokGZipper etc.
All text_terix fields will use the same validation script which will result in smaller generated pages.
A page with 10 text fields and "float" validation generated before around 12,500 bytes for the text fields including individual validation, now it is down to 2,600 Bytes.
10 August 2010
Added inputbox class (allows styling through Joomla template and for consistency with other fields)
18 August 2010 V2.1
1) Added new validation types (IP Address, Time HH:MM)
2) Added "Validation Message" for error display (if left blank, no message box will pop up)
3) Added "Validation Method" (Full Validation / On Keystroke)
Some regular expressions can not be validated after every single keystroke, this is when "Full Expression" should be selected. "Full Expression" validates after leaving the entry field.
4) Improved "On Keystroke" validation. (handles "holding down" of keys)
5) Put validation javascript in separate file/installer to share logic with other fields.
6) Small improvements

Plugin


Profile of sackgesicht
Add a Friend
All User Extensions (5)
Send Message
on 

+1 (209) 800 1209