Front-End Development Javascript jQuery Plugin

Authored by Corey Ballou

1 Comment

Salid (jQuery Simple Validation Plugin) Update

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.

Click here to visit the Salid project page.

Author: Corey Ballou

Corey Ballou is the CEO of Whether you're a student, young professional, entrepreneur, startup, or small business, you can be up and online fast with your own custom domain, email, and webpage on POP. Corey is a professional PHP developer by trade, specializing in custom web applications development for startups, small businesses, and agencies. Follow Corey on Twitter @cballou.

  • Web Developer Rob

    Have used this plugin quite a l9ot lately, it’s fairly compact and handles the basics of validation very well – which is what I always aim for client side, leaving the heaver checking (E.g. pattern matching etc.) to the server side.