Advanced Text Attribute with Validation

Permalink
I've just created a new attribute, uploaded it to the marketplace, and also to github.

It adds a text attribute to your site that includes advanced validation (e.g. URL, email address), including RegExp. Also, formatting of the output value.

This is a replacement for the existing c5 text attribute. It behaves the same, but allows you, during setup (ie, the place where you define the handle), to also define validation and formatting options. The following are the existing validation options:

Format
* None (same as current c5 text attribute)
* URL (must be in URL format)
* Email (must be in email format)
* RegExp (you can provide a regular expression that the field is formatted against)
Required - Requires a value to be entered
Validation is done in javascript with the excellent jQuery Valdation plugin. (Server side validation should be added in the future, but is difficult because attribute editing isn't done in isolation -- it's part of a larger form.)

Additionally, you can choose that, when not being edited, the value is formatted. If, it's validated as a URL it'll be displayed as a clickable URL.

The github URL ishttps://github.com/jamesshannon/Advanced-Text-Attribute...

James

jshannon
 
mesuva replied on at Permalink Reply
mesuva
This sounds great James, I've already got ideas in mind for how this could be used. Cheers for sharing.
jshannon replied on at Permalink Reply
jshannon
Feel free to contribute back. It's definitely a beta and could use some cleaning.

Also, I'm curious how you end up using it; please report back.