PortableSheep / Pliant

A jQuery validation plugin that allows easy extending/overriding of rules, as well as defining field validation by html comments.
http://portablesheep.github.com/Pliant/
Other
6 stars 3 forks source link

Add ability to specify classes and content to decorate a target with per field. #7

Closed PortableSheep closed 12 years ago

PortableSheep commented 12 years ago

Add the ability to specify classes, content, and position of content to decorate a target with per field being added for validation.

This would allow the user to have an easier way to add asterisks or whatever to field labels, while giving better control. The decorations should also hide/show based on the fields validation being enabled/disabled/removed.

This could be a plugin, but if small and useful enough could be in the core.

Possible option format, allowing one lit obj, or an array of them:

decorate: {
    what: jQueryObj -or- '#selector',
    with: jQueryObj -or- 'content',
    how: 'Append/Prepend/Before/After',
    class: 'someclasses to add',
    sync: true|false //Controls the visibility of the dectoration based on the fields enabled/visibility state, and active rule count.
}