xoxco/jQuery-Tags-Input — pull request #46 by PrimozRome (2012-02-04 12:23:09+00:00)
Title: Added input validation for tags

Hello Ben. As discussed on the email, I have forked your code and added input tag validation option. Here is how it works:

## New - input validation

Added support for input validation by defining 'validateInput' settings.
You can set any regular expression and the input will get matched to
that regular expression. If the validation fails the onAddError callback will
get called. Example:

/* Validates if input tag is valid email */
$('#form_videos').tagsInput({
'width':'330px',
'height':'100px',
'defaultText':'dodaj video',
'validateInput':/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,
'onAddError': function(data) {
alert('Input is not a valit email address');
}
});