Three changes in this new version of Validanguage (available for download here):
- Added support for marking a field/validations as optional. This can be set up by declaring required=”false” for a form field. When a field is marked required=”false” and the field is left empty, it will always pass all its validations. You can see this in action in the birthdate field on the validanguage demo page — if you leave it empty, it will pass; enter anything that isn’t a valid date and it will fail. Note that an optional field will still be considered empty/valid if it contains only whitespace, like an extra space. I added this behavior since I concluded that most back-end form scripts should be stripping out extra whitespace prior to back-end validation as a “best practice”.
- Fixed support for Safari 4. Due to an issue with validanguage.empty(), it would go into an infinite loop when testing a DOM element. This caused all validation rules to be totally ignored in Safari 4.
- Fixed support for onsubmit form transformations. This has apparently been broken for a couple releases and I only now noticed and fixed it.
I’ve decided that Validanguage will be in a feature freeze until I release version 1.0.0. I’m going to concentrate on additional testing, bug fixes and possibly some refactoring before declaring a 1.0.0 release.
And now for the goodies…
- A new version of the validanguage CakePHP helper has been released. The new version *should* be compatible with PHP4 (I don’t actually have PHP4 installed to verify this). More importantly, the helper now correctly handles allowEmpty=”true” CakePHP validation rules — by converting allowEmpty from the model into required=”false” in the validanguage rules.
- I added a new Software Projects section to my website. Currently, I have 2 additional open source projects listed on this page (Click the link above for more details):
- PHP/Perl Benchmarking tools
- 2 helper functions to assist with creating JSON AJAX calls in PHP
After finishing up the items above, I’m going to start on a new software project. I’m getting married in 5 months and promised my fiancee I’d whip up a website she can use to record everyone’s dinner order and create a virtual seating chart. I may end up posting this online too, but I’m not sure how useful it’ll be to anyone else. But, hey, you never know…