Version 0.2 of salid, a simple jquery validation plugin, has been officially released. The update includes a number of important bug fixes and optimizations. If you encounter any bugs please contact me as it benefits the community. Below is a list of the changes.
Fix to required validation function
The required validation function was not properly working with radios and checkboxes. The required function now tests whether the form elements are checked as opposed to checking for a non-existant value.
Added phone number validation
Since phone numbers are so commonly used on forms, I went ahead and added it to the list of default validation methods included with the plugin.
Fixed error display for checkboxes and radios
Due to the fact no two browsers handle checkbox and radio styling alike, the default error styling would not suffice. For starters, adding a class to the elements themselves would have no effect on their appearance as the border and background properties often cannot be overriden. For these reasons, you should now be wrapping your checkboxes and radio buttons in a
<label> tag. The error handler will apply error styles to the parent label tag as opposed to the usual application directly on the element itself.
Fixed issue with duplicate form elements
In the event a user had multiple forms on a page that shared at least one common form element name, jQuery would only match the first element found on the page if found by ID selector. Although it is not semantically correct to have two form elements with the same ID, Salid allows for such cases to occur due to the fact numerous frameworks automatically generate ID tags based on element names. The fix involves only allowing selection from children and descendants of the form tag from which Salid was initialized.